Improper lifecycle implementation
Closed this issue · 2 comments
kgregory commented
SwipeableViews
implements both getDerivedStateFromProps
and UNSAFE_componentWillReceiveProps
. This is causing the following warning:
Warning: Unsafe legacy lifecycles will not be called for components using new component APIs. ReactSwipableView uses getDerivedStateFromProps() but also contains the following legacy lifecycles: UNSAFE_componentWillReceiveProps The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-unsafe-component-lifecycles
Also, it is implementing UNSAFE_componentDidUpdate
which is not a real lifecycle method. It is probably meant to be either UNSAFE_componentWillUpdate
or componentDidUpdate
.
This change was introduced in #537
I am using:
"react": "16.12.0",
"react-swipeable-views": "0.13.6",
"react-swipeable-views-core": "0.13.6",
"react-swipeable-views-utils": "0.13.6",
yanickrochon commented
Also related to this issue #566
kgregory commented
SwipeableViews
implements bothgetDerivedStateFromProps
andUNSAFE_componentWillReceiveProps
.
Also, it is implementing
UNSAFE_componentDidUpdate
which is not a real lifecycle method. It is probably meant to be eitherUNSAFE_componentWillUpdate
orcomponentDidUpdate
.
None of these statements appear to be true any longer.
Closing.