Skip to content

Commit

Permalink
orb(react-native-mlkit): fix(docs): rename unreferenced conditional v…
Browse files Browse the repository at this point in the history
…ariable (#158 by @leonskim) (32970f13efe6f92b5a08289b9fe6cb9409c06734)
  • Loading branch information
infinitered-circleci committed Jul 30, 2024
1 parent 7752f67 commit 1e936f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/react-native-mlkit/object-detection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ function MyComponent() {
useEffect(() => {
// Loading models is done asynchronously, so in a useEffect we need to wrap it in an async function
async function loadModel() {
if (!model || modelIsLoaded) return;
if (!model || modelLoaded) return;
// load the model
await model.load();
// set the model loaded state to true
setModelLoaded(true);
}

loadModel();
}, [model, modelIsLoaded]);
}, [model, modelLoaded]);

// the output of the model is an array of `RNMLKitDetectedObject` objects
const [result, setResult] = useState<RNMLKitDetectedObject[]>([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ function MyComponent() {
React.useEffect(() => {
// Loading models is done asynchronously, so in a useEffect we need to wrap it in an async function
async function loadModel() {
if (!model || modelIsLoaded) return;
if (!model || modelLoaded) return;
// load the model
await model.load();
// set the model loaded state to true
setModelLoaded(true);
}

loadModel();
}, [model, modelIsLoaded]);
}, [model, modelLoaded]);

// the output of the model is an array of `RNMLKitDetectedObject` objects
const [result, setResult] = useState<RNMLKitDetectedObject[]>([]);
Expand Down

0 comments on commit 1e936f2

Please sign in to comment.