Skip to content

Commit a56a585

Browse files
fix(react-native-mlkit-object-detection): infinite render caused by default value (#182)
1 parent c5538d1 commit a56a585

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: modules/react-native-mlkit-object-detection/src/useObjectDetectionModels.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ type Models<T extends Record<string, any>> = {
2424
[K in keyof T | "default"]: RNMLKitObjectDetector;
2525
};
2626

27+
const assetsDefaultValue = {};
28+
2729
export function useObjectDetectionModels<T extends AssetRecord>({
28-
assets = {} as T,
30+
assets = assetsDefaultValue as T,
2931
loadDefaultModel,
3032
defaultModelOptions,
3133
}: {

0 commit comments

Comments
 (0)