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

Infinite Re-renders

Open iampato opened this issue 6 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

+1

DimaIvashchuk avatar Oct 29 '25 12:10 DimaIvashchuk

Hey @iampato - sorry for the delay here. We are gonna take a look at Expo 53 support soon, but in the meantime can you please add a full reproducer here so we can see the actual error? Want to make sure we are debugging your exact issue. Thanks!

coolsoftwaretyler avatar Nov 11 '25 22:11 coolsoftwaretyler

Try out the latest version, 4.0.0 which was built for Expo SDK 53. This issue isn't reproducible in the Example App if you take a look how it is used there perhaps.

frankcalise avatar Nov 14 '25 10:11 frankcalise

Since we haven't heard from @iampato and we've seen the updates fix this, I'm gonna close the issue out. Let us know if you still have problems!

coolsoftwaretyler avatar Nov 25 '25 14:11 coolsoftwaretyler