Updating react-scripts 4 -> 5, dynamic svg loading not working #721
-
I'm updating react-scripts from version 4 to version 5. This packages includes @svgr/webpack and got updated with it. We use a React hook which dynamically import a SVG file using I was looking for a solution/breaking change in the changelog but i could find a solution. Is there anybody who can tell me how to fix importing the SVG with the updated @svgr/webpack package? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If you aren't worried about optimising with svgo and the titleProp and ref options try change the dynamic import to
Seemed to work for me. |
Beta Was this translation helpful? Give feedback.
-
Solution: https://ryanhutzley.medium.com/dynamic-svg-imports-in-create-react-app-d6d411f6d6c6
|
Beta Was this translation helpful? Give feedback.
Solution: https://ryanhutzley.medium.com/dynamic-svg-imports-in-create-react-app-d6d411f6d6c6