React-native-snap-carousel: ComponentWillReceiveProps deprecated

Created on 4 Jun 2019  路  7Comments  路  Source: meliorence/react-native-snap-carousel

WhatsApp Image 2019-06-04 at 11 34 21 AM

I have been experiencing this warning.
I am currently using react-native: 0.59.6
The current react-native-snap-carousel is 3.8.0

Can you help me out to deal with this one please?

Most helpful comment

The Pagination component also has this issue. The package does need an update to replace componentWillReceiveProps.

All 7 comments

You can use componentDidUpdate and compare actual props with prevProps instead of nextProps :)

The deprecation warning is not fired from consumers code but from the Carousel component itself. Indeed internally it has componentWillReceiveProps defined.

As a temporary solution for my project I explicitly ignored the warning:

// top level index.js
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: componentWillReceiveProps']);

The Pagination component also has this issue. The package does need an update to replace componentWillReceiveProps.

any update ?

+1

Hi guys,

@kiarashws was kind enough to submit a PR for that (see #568).

Now I need you to try it in order to make sure that everything is working properly. Once I get enough positive feedback, this will get merged :-)

Available in version 3.8.1.

Was this page helpful?
0 / 5 - 0 ratings