react-swipeable-views icon indicating copy to clipboard operation
react-swipeable-views copied to clipboard

Getting waring in React 16.8.6 about ComponentWillRecieveProps

Open vikas-0 opened this issue 5 years ago • 37 comments

The warinig is as follows:

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks 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://fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: ReactSwipableView

vikas-0 avatar Aug 10 '19 11:08 vikas-0

According to react 16.9.0 componentWillMount, componentWillReceiveProps and componentWillUpdate were deprecated and will be removed in 17.x version https://alligator.io/react/whats-new-in-react-16.9/

k-timoshenko avatar Aug 13 '19 14:08 k-timoshenko

Still receiving the error message. version 0.13.2 Screen Shot 2019-08-24 at 2 42 55 PM

bahtiyara avatar Aug 24 '19 06:08 bahtiyara

Hi, I also get this issue, here is error message from the console :

  Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks 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://fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: ReactSwipableView

AurelTBE avatar Aug 31 '19 18:08 AurelTBE

react-select had this issue lately and they fixed it with this pr. something similar could be done temporarily.

mehmetnyarar avatar Sep 03 '19 09:09 mehmetnyarar

react-select had this issue lately and they fixed it with this pr. something similar could be done temporarily.

It will still be temporary solution

vikas-0 avatar Sep 09 '19 06:09 vikas-0

Still facing problem

Uttu316 avatar Sep 21 '19 09:09 Uttu316

Still facing problem

ValentinMumble avatar Oct 01 '19 17:10 ValentinMumble

Receiving the same warning. Any update on a fix?

cameronpalatas avatar Oct 21 '19 05:10 cameronpalatas

Hi. I received the same warning, too.

"Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details."

on the console.

I will wait for your fix. Thank you :)

lofty87 avatar Oct 23 '19 11:10 lofty87

I have no interest in investing time in this project anymore. The return is too low compared to the time I can bet on Material-UI. Does anyone want to keep up the development of it? Thanks.

oliviertassinari avatar Nov 13 '19 18:11 oliviertassinari

@oliviertassinari It will be great if you add a big "Looking For Maintainers" heading in the README.md.

mwskwong avatar Nov 15 '19 02:11 mwskwong

@oliviertassinari, you mean that material UI could replace this project? And what would be the most important functions to implement or problems to fix? Any possible roadmap for the new maintainers?

vanvuongngo avatar Nov 15 '19 15:11 vanvuongngo

To clarify, I meant that I don't have time to dedicate to this project.

On Material-UI side, we will work on a carousel, but it's unclear if we will actually use this library.

oliviertassinari avatar Nov 15 '19 16:11 oliviertassinari

Receiving the same warning. Any update on a fix?

payandeh avatar Dec 12 '19 15:12 payandeh

Help please!!

icastillejogomez avatar Mar 02 '20 15:03 icastillejogomez

@oliviertassinari is there a repo I could check out for the Material-UI carousel component? Thanks!

dohomi avatar Mar 03 '20 02:03 dohomi

@dohomi The carousel we will build for Material-UI will likely not use this component.

oliviertassinari avatar Mar 03 '20 10:03 oliviertassinari

@oliviertassinari great news that it will land in Material-UI itself. Will it be part of v4 and the material-ui/lab? Thanks for the info!

dohomi avatar Mar 04 '20 01:03 dohomi

@dohomi we will soon start the v5 effort. I think that it will come after.

oliviertassinari avatar Mar 04 '20 06:03 oliviertassinari

Hey Guys, I see that this wonderful stuff is getting outdated, and maintenance is not provided. I moved to https://github.com/express-labs/pure-react-carousel after trying a lot of jQuery ported solutions such as slick, or other solutions like nuka-carousel. I think this, pure-react-carousel is the best alternative out there at the moment.

davidkutas avatar Jun 25 '20 21:06 davidkutas

@oliviertassinari please add Deprecation label or stale label to the Git repo so we may stop using it. Thank you for this wonderful library

nagad814 avatar Aug 05 '20 10:08 nagad814

Workaround implemented in #616, release coming soon.

caleb-harrelson avatar Aug 14 '20 03:08 caleb-harrelson

Do we have confirmation from the owner that this will continued to be maintained? We are intending to use this for production and this seems like the best and most suitable we have tested yet.

daveteu avatar Sep 03 '20 21:09 daveteu

Hi Guys,

it looks like it is still a open issue? Are there any plans to fix it?

[Error] Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/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://reactjs.org/link/derived-state

Please update the following components: ReactSwipableView

sakstone avatar Jul 14 '21 20:07 sakstone

Hi Guys,

it looks like it is still a open issue? Are there any plans to fix it?

[Error] Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/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://reactjs.org/link/derived-state

Please update the following components: ReactSwipableView

I'm too getting this Warning in dev console.

agnel avatar Mar 04 '22 16:03 agnel

Hi Guys, it looks like it is still a open issue? Are there any plans to fix it?

[Error] Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/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://reactjs.org/link/derived-state

Please update the following components: ReactSwipableView

I'm too getting this Warning in dev console.

A fix is ready in PR but, if my understanding is right, it won't be merged, the author advises using the MUI lib instead.

https://github.com/oliviertassinari/react-swipeable-views/pull/654

korbav avatar Mar 04 '22 16:03 korbav

@korbav Why does the author advise using MUI ? Is there a similar component in MUI ?

agnel avatar Mar 04 '22 20:03 agnel

@korbav Why does the author advise using MUI ? Is there a similar component in MUI ?

To be honest, I'm not sure, I'm not really getting it. To my knowledge, there's nothing similar.

korbav avatar Mar 04 '22 20:03 korbav

@korbav Why does the author advise using MUI ? Is there a similar component in MUI ?

Because he is "CEO, co-founder at https://github.com/mui"

k-timoshenko avatar Mar 04 '22 21:03 k-timoshenko

@korbav Why does the author advise using MUI ? Is there a similar component in MUI ?

Because he is "CEO, co-founder at https://github.com/mui"

@t-kanstantsin Okay, this answers the "Why?".

Could you help me out with the "How?". ? Or provide any guidance or hint on it?

agnel avatar Mar 04 '22 21:03 agnel