Skip to content

Commit

Permalink
Merge pull request #42 from stefanpl/adjust-readme-for-typescript
Browse files Browse the repository at this point in the history
hints for using with typescript
  • Loading branch information
jacobmischka authored Sep 30, 2020
2 parents bc355a3 + b947cdc commit 69d5722
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ In styles file:
}
```

## Using with typescript

To use SVGs with Typescript, create a custom type definition like this:

```typescript
declare module "*.svg" {
const content: any;
export default content;
}
```

Make sure the file is contained in your `tsconfig.json` `include`.

### SVG-React-Loader options

Any of the svg-react-loader [query parameters](https://github.com/jhamlet/svg-react-loader#query-params) can be passed down via the webpack config by including an `options` prop within the `rule` prop.
Expand Down

0 comments on commit 69d5722

Please sign in to comment.