Closed tancredi closed 1 year ago
Is it already solved? I tried updating the package to version 3.5.5 but the warning still occurs. Also manually changing componentWillReceiveProps to componentDidMount breaks it (card is no longer flipping). My solution was to change it manually to UNSAFE_componentWillReceiveProps.
@devstarman you'd probably want to use getDerivedStateFromProps
, as componentDidMount
is only run once, not when new props arrive:
From the warning message:
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://fb.me/react-derived-state
Uses
componentWillReceiveProps
which is deprecated (https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops) though there should be no problem just replacing it withcomponentDidUpdate
- thoughts?