react-native-svg not working with react native web #2204
Unanswered
Prashant-Mobile-Server
asked this question in
Q&A
Replies: 1 comment
-
I have the same issues, what is your solution after, replace every direct import of svg ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Getting error when trying to load svg image from a local directory. It is working fine on mobile but has below issue when I try to run for web.
Uncaught runtime errors:
×
ERROR
The string contains invalid characters.
createElement@[native code]
createElement@
createInstance@
completeWork@
completeUnitOfWork@
performUnitOfWork@
workLoopSync@
renderRootSync@
recoverFromConcurrentError@
performConcurrentWorkOnRoot@
workLoop@
flushWork@
performWorkUntilDeadline@
### Made below changes to support on mobile:
custom.d.ts:
declare module '*.svg' { const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>; export default content; }
tsconfig.json:
{
"compilerOptions": {
"jsx": "react"
},
"extends": "@tsconfig/react-native/tsconfig.json",
"include": ["/*.ts", "/*.tsx", "custom.d.ts"]
}
Beta Was this translation helpful? Give feedback.
All reactions