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 will be deprecated #87

Open
iqqmuT opened this issue Sep 24, 2018 · 4 comments · May be fixed by #109
Open

componentWillReceiveProps will be deprecated #87

iqqmuT opened this issue Sep 24, 2018 · 4 comments · May be fixed by #109

Comments

@iqqmuT
Copy link

iqqmuT commented Sep 24, 2018

According to React, using componentWillReceiveProps() is a bad idea and it will be deprecated soon, version 17 seems to be the last supporting the method with that name.

When using keydown for classes, what should be the proper way to handle the key events?

@glortho
Copy link
Owner

glortho commented Sep 24, 2018

One way to do this will be to do the detection in getDerivedStateFromProps and return state related to keydown state that you can then reference in other lifecycle methods.

https://hackernoon.com/replacing-componentwillreceiveprops-with-getderivedstatefromprops-c3956f7ce607

@glortho glortho closed this as completed Sep 24, 2018
@jamesremuscat
Copy link

Apologies for commenting on a long-closed issue, but does the fact that it's closed mean that you don't intend to update method_decorator_scoped.js to avoid using componentWillReceiveProps?

@glortho
Copy link
Owner

glortho commented Aug 19, 2019

Hi @jamesremuscat -- I'm a bit swamped at the moment but very happy to review a PR if anyone wants to tackle this. Reopening.

@glortho glortho reopened this Aug 19, 2019
@faq885
Copy link

faq885 commented Feb 13, 2020

interested in this one, how to handle new function components? , is there a way to use keydown with compose?

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

Successfully merging a pull request may close this issue.

4 participants