-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Improve svgr documentation #20893
Conversation
Using the `@svgr/webpack` loader it loads the svg files as a js module exporting a component named as ReactComponent and the source of the svg as the default export. The example is invalid because it's adding at the component attribute the default export and that causes the error: ``` Failed to execute 'createElement' on 'Document': The tag name provided ```
Details of bundle changes.Comparing: 4bfcbec...256ae6e Details of page changes
|
@tavantzo Is that's because you are coming from CRA that overrides the behavior of @svgr/webpack? |
It seems to be confirmed with https://react-svgr.com/docs/webpack/#using-with-url-loader-or-file-loader. |
Sorry, I had to add a reference at the svgr documentation as well. |
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
@tavantzo It's a great first pull request on Material-UI 👌🏻. Thank you for working on it! |
Using the
@svgr/webpack
loader it loads the svg files as a js module exporting a component named as ReactComponent and the source of the svg as the default export.The example is invalid because it's adding at the component attribute the default export and that causes the error: