Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting waring in React 16.8.6 about ComponentWillRecieveProps #534

Open
vikas-0 opened this issue Aug 10, 2019 · 37 comments
Open

Getting waring in React 16.8.6 about ComponentWillRecieveProps #534

vikas-0 opened this issue Aug 10, 2019 · 37 comments

Comments

@vikas-0
Copy link

vikas-0 commented Aug 10, 2019

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

@k-timoshenko
Copy link

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/

@bahtiyara
Copy link

bahtiyara commented Aug 24, 2019

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

@AurelTBE
Copy link

AurelTBE commented Aug 31, 2019

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

@mehmetnyarar
Copy link

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

@vikas-0
Copy link
Author

vikas-0 commented Sep 9, 2019

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

@Uttu316
Copy link

Uttu316 commented Sep 21, 2019

Still facing problem

1 similar comment
@ValentinMumble
Copy link

Still facing problem

@cameronpalatas
Copy link

Receiving the same warning. Any update on a fix?

@lofty87
Copy link

lofty87 commented Oct 23, 2019

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 :)

@oliviertassinari
Copy link
Owner

oliviertassinari commented Nov 13, 2019

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.

@mwskwong
Copy link

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

@vanvuongngo
Copy link

@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?

@oliviertassinari
Copy link
Owner

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.

@payandeh
Copy link

Receiving the same warning. Any update on a fix?

@icastillejogomez
Copy link

Help please!!

@dohomi
Copy link

dohomi commented Mar 3, 2020

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

@oliviertassinari
Copy link
Owner

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

@dohomi
Copy link

dohomi commented Mar 4, 2020

@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!

@oliviertassinari
Copy link
Owner

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

@davidkutas
Copy link

davidkutas commented Jun 25, 2020

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.

@nagad814
Copy link

nagad814 commented Aug 5, 2020

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

@caleb-harrelson
Copy link
Collaborator

Workaround implemented in #616, release coming soon.

@daveteu
Copy link

daveteu commented Sep 3, 2020

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.

@sakstone
Copy link

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

@agnel
Copy link

agnel commented Mar 4, 2022

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.

@korbav
Copy link

korbav commented Mar 4, 2022

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.

#654

@agnel
Copy link

agnel commented Mar 4, 2022

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

@korbav
Copy link

korbav commented Mar 4, 2022

@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.

@k-timoshenko
Copy link

@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"

@agnel
Copy link

agnel commented Mar 4, 2022

@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?

@k-timoshenko
Copy link

@agnel Sorry I don't have solution or replacement.
I just pointed why there is no chance to receive support in this repository.

@flying-sheep
Copy link

flying-sheep commented Jun 20, 2022

the author advises using the MUI lib instead.

I doubt it, since the author explicitly refers from mui’s docs and issue tracker to react-swipeable-views instead: mui/material-ui#507

@mschwartz
Copy link

2022-10-07 at 1 45 PM

@sermunar
Copy link

omg he made a carousel out of it, guys, we are in a loop. please help!

@christiaanwesterbeek
Copy link

I am probably gonna receive some thumbs down for this, but I got annoyed by the error just enough to implement the following wrapper for console.error to silence this particular message.

const consoleError = console.error;

console.error = function filterErrors(msg, ...args) {
    if (/UNSAFE_componentWillReceiveProps/.test(msg) && args[0] === 'ReactSwipableView') {
        return;
    }
    consoleError(msg, ...args);
};

@sneko
Copy link

sneko commented Sep 1, 2023

@Grsmto took the time to publish a fix in a forked package (thank you!). It works on my side (I didn't want to search for an alternative). I keep using the original name to benefit from typings...

Just use:

  • npm install react-swipeable-views@npm:@gromy/react-swipeable-views
  • yarn add react-swipeable-views@npm:@gromy/react-swipeable-views
  • pnpm add react-swipeable-views@npm:@gromy/react-swipeable-views
  • or install @gromy/react-swipeable-views directly

@mparisi76
Copy link

@Grsmto took the time to publish a fix in a forked package (thank you!). It works on my side (I didn't want to search for an alternative). I keep using the original name to benefit from typings...

Just use:

  • npm install react-swipeable-views@npm:@gromy/react-swipeable-views
  • yarn add react-swipeable-views@npm:@gromy/react-swipeable-views
  • pnpm add react-swipeable-views@npm:@gromy/react-swipeable-views
  • or install @gromy/react-swipeable-views directly

fyi does not work with React 18..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests