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

rename react lifecycle methods to prefix "UNSAFE_" #575

Conversation

theopak
Copy link
Contributor

@theopak theopak commented Nov 8, 2019

hi @chenglou and @nkbt! what do you think of potentially shipping this quick rename? it comes from $ npx react-codemod rename-unsafe-lifecycles and would make the developer experience a little better for consumers that are on react v16.9, like we are at @Frameio

for anyone just catching up with this situation — please note that this rename fixes the console warnings introduced in react@16.9 such that code will run in react@17, but this rename doesn't address the underlying issue

edit: i pushed a config change just to get the build to pass, so please lmk if there's a different way that would work better here

    - via `npx react-codemod rename-unsafe-lifecycles`
    - using options: ./src, "JavaScript with Flow"
    - fixes console warnings for react v16.9.0
    - fixes react v17 compatibility
    - note that this doesn't do address the underlying motive of the
      warnings regarding unsafe component lifecycle methods
@theopak
Copy link
Contributor Author

theopak commented Nov 8, 2019

technically fixes #569

Copy link
Collaborator

@nkbt nkbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, as a tmp solution before #534

Not sure why eslint change though, but as build looks good anyway - no problem with me

@theopak
Copy link
Contributor Author

theopak commented Nov 11, 2019

@nkbt awesome! i don't have merge permission though, can you merge this?

yes, the eslint change was just to get the build to pass

@nkbt
Copy link
Collaborator

nkbt commented Nov 12, 2019

I've tested this PR and also check if built version works ok in one of my projects and everything seems to work well without React warnings. Merging in.

@nkbt nkbt merged commit 5d64304 into chenglou:master Nov 12, 2019
@nkbt
Copy link
Collaborator

nkbt commented Nov 12, 2019

Cannot publish until #577

@theopak theopak deleted the theopak/2019-11-08-rename-unsafe-lifecycle-methods branch November 12, 2019 19:49
@petrkrejcik
Copy link

Hi @nkbt, will you make a release with this change?

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

Successfully merging this pull request may close these issues.

None yet

3 participants