We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Must SVGUri uri be http/https? Can use data: image/svg+XML; Base64 format
Need to directly pass base64 to SVG,I found that requests are made in the source code。
export function SvgUri(props: UriProps) { const { onError = err, uri, onLoad, fallback } = props; const [xml, setXml] = useState<string | null>(null); const [isError, setIsError] = useState(false); useEffect(() => { uri ? fetchText(uri) .then((data) => { setXml(data); isError && setIsError(false); onLoad?.(); }) .catch((e) => { onError(e); setIsError(true); }) : setXml(null); // eslint-disable-next-line react-hooks/exhaustive-deps }, [onError, uri, onLoad]); if (isError) { return fallback ?? null; } return <SvgXml xml={xml} override={props} fallback={fallback} />; }
The text was updated successfully, but these errors were encountered:
feat: add support base64 uri type in SvgUri component (#2444)
14a131c
# Summary Feature #2142 Add support for data: image/svg+XML; Base64 format. ## Test Plan TestExample app -> src -> Test2142 ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | MacOS | ✅ | | Android | ✅ | | Web | ✅ | --------- Co-authored-by: Jakub Grzywacz <[email protected]>
No branches or pull requests
Feature Request
Must SVGUri uri be http/https? Can use data: image/svg+XML; Base64 format
Why it is needed
Need to directly pass base64 to SVG,I found that requests are made in the source code。
Code sample
The text was updated successfully, but these errors were encountered: