You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have been using <SvgUri uri={...} /> to load and display svg images from a site. However this is sometimes causing a captcha page to be loaded, which then causes an app crash.
This happens when SvgUri calls SvgXml with the "xml" (really the html error page), and that fails when parseing the data.
Wrapping parse in a try catch and rendering a null fixed the crash.
But there are SvgFromUri and SvgFromXml classes in src/xml.tsx, and SvgFromXml already handles parsing errors.
We are on an old version of react-native-svg, but similar functions and classes exist on main.
What is the difference between SvgUri/SvgXml and SvgFromUri/SvgFromXml?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have been using
<SvgUri uri={...} />
to load and display svg images from a site. However this is sometimes causing a captcha page to be loaded, which then causes an app crash.This happens when
SvgUri
callsSvgXml
with the "xml" (really the html error page), and that fails whenparse
ing the data.Wrapping
parse
in a try catch and rendering anull
fixed the crash.But there are
SvgFromUri
andSvgFromXml
classes insrc/xml.tsx
, andSvgFromXml
already handles parsing errors.We are on an old version of
react-native-svg
, but similar functions and classes exist onmain
.What is the difference between
SvgUri
/SvgXml
andSvgFromUri
/SvgFromXml
?Beta Was this translation helpful? Give feedback.
All reactions