client-sdk-react-native icon indicating copy to clipboard operation
client-sdk-react-native copied to clipboard

UNSAFE_componentWillReceiveProps errors in strict mode

Open mfairley opened this issue 2 months ago • 1 comments

The library produces error logs in React Strict Mode due to https://github.com/livekit/client-sdk-react-native/blob/main/src/components/ViewPortDetector.tsx#L103

Any plans to fix this?

 ERROR  Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state

Please update the following components: %s ViewPortDetector 

mfairley avatar Dec 23 '25 02:12 mfairley

Hmm, we should be able to switch to componentDidUpdate here.

davidliu avatar Jan 08 '26 19:01 davidliu