Skip to content

Commit 77b1de7

Browse files
authored
try different import of AssetRegistry (#398)
1 parent 54f7346 commit 77b1de7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/Material/ViroMaterials.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ import {
1616
NativeModules,
1717
processColor,
1818
} from "react-native";
19+
1920
// @ts-ignore
20-
import assetRegistry from "react-native/Libraries/Image/AssetRegistry";
21+
import { getAssetByID } from "react-native/Libraries/Image/AssetRegistry";
22+
2123
// @ts-ignore
2224
import resolveAssetSource from "react-native/Libraries/Image/resolveAssetSource";
2325
import { ViroSource } from "../Types/ViroUtils";
@@ -104,7 +106,7 @@ export class ViroMaterials {
104106
} else {
105107
var assetType = "unknown";
106108
if (typeof material[prop] !== "object") {
107-
var asset = assetRegistry.getAssetByID(material[prop]);
109+
var asset = getAssetByID(material[prop]);
108110
if (asset) {
109111
assetType = asset.type;
110112
}

0 commit comments

Comments
 (0)