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

componentWillReceiveProps warning in React 16.9 #649

Closed
raptor1989 opened this issue Aug 26, 2019 · 16 comments
Closed

componentWillReceiveProps warning in React 16.9 #649

raptor1989 opened this issue Aug 26, 2019 · 16 comments

Comments

@raptor1989
Copy link

I just wanted to point out that I updated to react@16.9.0 and react-dom@16.9.0 and got the following warning in the console:

VM1239 backend.js:6 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: DateTime
@jukkahuuskonen
Copy link

Is there any work done on this? This repo can't be used with React v.17+, once it it arrives.

@jamesjenkinsjr
Copy link

jamesjenkinsjr commented Oct 25, 2019

I reached out to the most recent contributor, @arqex, in hopes they might be able to at least append the band-aid of UNSAFE_ to it 👌 😄

UPDATE: Reached out to @arqex and he confirmed they're working on a solution now that is nearly ready

@wschmrdr
Copy link

Any further updates? Would prefer to not have to find another date and time picker...

@QuentinG3
Copy link

Any news on this?

@arqex
Copy link
Owner

arqex commented Jan 13, 2020

Sorry about the delay when replying. This issue is already been handled in the v3 branch that's going to be released soon, we've just need to update the docs there before releasing.

@davidcostadev
Copy link

@arqex Could you add a hot fix to the v2?, because I have afraid of breakchanges.

@afcjunior
Copy link

@arqex

The band-aid that removes that warning from the console is implemented in this pull request: #674

That PR is not currently passing the CI due to a pre-existing problem in master, which my friend David identified and fixed in this pull request: #684

Once his PR gets merged, I'll update mine so it will pass the CI too.

Having both merged would be great because then you'd be able to leave V2 working and without warnings, so those of us that can't simply upgrade to V3 will still have a clean console. <3

@codebury
Copy link

@arqex Could you add a hot fix to the v2?, because I have afraid of breakchanges.

By the way, tried v3 and value does not work well using a state hook variable. I mean, the value get applied but when the view gets oppened, it shows the current month. If you navigate to the date that was set to the variable, the day was correctly selected. I noticed that there's an internal state inputValue that doesn't get updated. Best regards.

@arqex
Copy link
Owner

arqex commented Feb 20, 2020

Hey @codebury

I don't get what you mean, could you set an example for me forking this sandbox?

https://codesandbox.io/s/boring-dew-uzln3

@codebury
Copy link

codebury commented Feb 20, 2020

Hey @codebury

I don't get what you mean, could you set an example for me forking this sandbox?

https://codesandbox.io/s/boring-dew-uzln3

Hi!

Yes, of course:

https://codesandbox.io/s/reverent-worker-60drr

Thanks for quick reply.

@TrishaPatel
Copy link

Is problem resolved? Datepicker was working fine. After i upgrade npm it is not working properly and giving an warning in console. CSS is not working properly.
Screenshot from 2020-03-03 10-19-43

@arqex
Copy link
Owner

arqex commented Mar 3, 2020

@codebury Thanks for the example, I missed the notification and I've just had a look now. I know now what you mean, and you are right it's something to fix before the big release.

@TrishaPatel Sorry about the warnings, but still no fix for that. Anyway I don't think your issues are related to any update of the v2 of library, seems that you are having some z-index issues in that images.

@TrishaPatel
Copy link

ya I am trying to fix that manually. But it was working fine. I don't know after which update it is showing like this.

@obrejla
Copy link

obrejla commented Apr 16, 2020

Hi all, how does it look like with the fix of componentWillReceiveProps warning? It's a bit annoying. Thanks for the update!

@rei27jangao
Copy link

Hi all, any updates for this one?

@arqex
Copy link
Owner

arqex commented Sep 20, 2020

Thanks for raising the issue, and sorry for the delay! It's fixed as part of version 3 🙂

@arqex arqex closed this as completed Sep 20, 2020
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