Skip to content

Commit 0080040

Browse files
committed
Add README.md
1 parent 16c1506 commit 0080040

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# react-app-rewire-svgr
2+
3+
Add [SVGR](https://github.com/smooth-code/svgr) loader to your [create-react-app](https://github.com/facebookincubator/create-react-app) via [react-app-rewired](https://github.com/timarney/react-app-rewired).
4+
5+
## Installation
6+
7+
```
8+
yarn add --dev react-app-rewire-svgr
9+
```
10+
11+
OR
12+
13+
```
14+
npm install --save-dev react-app-rewire-svgr
15+
```
16+
17+
## Usage
18+
In your react-app-rewired configuration:
19+
```js
20+
/* config-overrides.js */
21+
22+
const rewireSVGR = require('react-app-rewire-svgr');
23+
24+
module.exports = function override(config, env) {
25+
// ...
26+
config = rewireSVGR(config, env);
27+
// ...
28+
return config;
29+
}
30+
```
31+
In your React application:
32+
```js
33+
import Star from './star.svg'
34+
35+
const App = () => (
36+
<div>
37+
<Star />
38+
</div>
39+
)
40+
```

0 commit comments

Comments
 (0)