Closed shovel-kun closed 4 weeks ago
You have to await the execute
https://github.com/shovel-kun/op-sqlite-useeffect-repro/blob/main/App.tsx#L77
@ospfranco Added the fix, but the reactiveExecute still doesn't unsubscribe on unmount.
LOG Effect mounted
LOG Pressed!
LOG Callback ran!
LOG Effect unmounting
LOG Effect mounted
LOG Pressed!
LOG Callback ran!
LOG Callback ran!
LOG Effect unmounting
LOG Effect mounted
LOG Pressed!
LOG Callback ran!
LOG Callback ran!
LOG Callback ran!
ah, I see it now. Give me some minutes I'll take a look.
Found the issue, will publish a new version soon
What happened?
Description
I've observed two bugs when using reactiveExecute with useEffect and useState:
Motivation
What I want to do is:
Does anyone have a workaround that allows me to accomplish the above?
op-sqlite version
9.2.6
React Native version
New Arch 0.76, but can be reproduced on older RN versions.
Reproducible Example
https://github.com/shovel-kun/op-sqlite-useeffect-repro
See instructions in
App.tsx
for repro.Expected logs:
Actual logs: