-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite loop when used with react-native-web View #359
Comments
Yeah, this is because they always trigger the ref callback function. The ref callback they create should be wrapped in a |
I might also be able to modify the ref callback, so it doesn't recreate the observer if it's the same element and options. |
i find when i use i use useInView to set ref it is a bug? sample code :https://codesandbox.io/s/serverless-cache-z7hdv?fontsize=14&hidenavigation=1&theme=dark |
It's because you are creating a new threshold: [0.5] Make sure to define the array outside the render function, or memorize it. |
@wildfrontend I made a new release that should prevent that issue. #404 |
@MoOx - In case you haven't noticed, this issue was resolved by react-native-web in necolas/react-native-web#1746 |
Everything is in the title. No issue with a div, as soon as I try to use RNW View, a infinite loop is started.
This is likely due to how RNW handle ref for the View (and maybe others)
https://github.com/necolas/react-native-web/blob/251cdfb220a165dc652bf118063139da2b9345f1/packages/react-native-web/src/exports/View/index.js#L104-L140
The text was updated successfully, but these errors were encountered: