mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-24 03:35:43 +00:00
fix: read svg file on android (#2016)
PR fixing the behavior for fetching local files in `SvgUri` on `Android`. Co-authored-by: Wojciech Lewicki <wojciech.lewicki@swmansion.com>
This commit is contained in:
+1
-1
@@ -122,7 +122,7 @@ export function SvgXml(props: XmlProps) {
|
||||
|
||||
export async function fetchText(uri: string) {
|
||||
const response = await fetch(uri);
|
||||
if (response.ok) {
|
||||
if (response.ok || (response.status === 0 && uri.startsWith('file://'))) {
|
||||
return await response.text();
|
||||
}
|
||||
throw new Error(`Fetching ${uri} failed with status ${response.status}`);
|
||||
|
||||
Reference in New Issue
Block a user