react-native-mlkit icon indicating copy to clipboard operation
react-native-mlkit copied to clipboard

Infinite Re-renders

Open iampato opened this issue 3 months ago • 4 comments

Rn: 0.79.5 Expo: 53 my app keeps on rerendering

const MODELS: ObjectDetectionConfig = {
  selfieDetector: {
    model: require("../assets/models/selfie_multiclass_256x256.tflite"),
  },
};

export default function RootLayout() {
  // Load the models
  const models = useObjectDetectionModels({
    assets: MODELS,
    loadDefaultModel: false,
    defaultModelOptions: {
      shouldEnableMultipleObjects: true,
      shouldEnableClassification: true,
      detectorMode: "singleImage",
    },
  });

  // Get the provider component
  const { ObjectDetectionProvider } = useObjectDetectionProvider(models);

  return (
      <ObjectDetectionProvider>
<! -- children -->
  </ObjectDetectionProvider>
);

iampato avatar Aug 25 '25 10:08 iampato