Skip to content

Commit 46e6b74

Browse files
committed
docs: update usages
1 parent 18a4e26 commit 46e6b74

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export default {
1616
};
1717
```
1818

19-
Then SVG files can be imported as React components, just like [create-react-app](https://create-react-app.dev/docs/adding-images-fonts-and-files#adding-svgs) does:
19+
Then SVG files can be imported as React components:
2020

2121
```js
22-
import { ReactComponent as Logo } from "./logo.svg";
22+
import Logo from "./logo.svg?react";
2323
```
2424

2525
If you are using TypeScript, there is also a declaration helper for better type inference:
@@ -32,10 +32,6 @@ If you are using TypeScript, there is also a declaration helper for better type
3232

3333
```js
3434
svgr({
35-
// Set it to `true` to export React component as default.
36-
// Notice that it will override the default behavior of Vite.
37-
exportAsDefault: false,
38-
3935
// svgr options: https://react-svgr.com/docs/options/
4036
svgrOptions: {
4137
// ...
@@ -46,8 +42,8 @@ svgr({
4642
// ...
4743
},
4844

49-
// A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should include. By default all svg files will be included.
50-
include: "**/*.svg",
45+
// A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should include. By default all svg files will be included.
46+
include: "**/*.svg?react",
5147

5248
// A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.
5349
exclude: "",

0 commit comments

Comments
 (0)