Rename unsafe component lifecycle methods #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @bcherny, Thanks a bunch for this tool. It's making migrating to react possible for us 🎉 .
I'm getting some noise in the console because of this, and #32 is asking for it.
Even though there was only two instances I used
npx react-codemod rename-unsafe-lifecycles
to be extra safe. apart from the fact that it also added a semicolon on line 105 of index.tsx which I removed again.Facebooks link for why they were renamed.
https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html
Tests are passing, obviously, an update of React was needed for these the new lifecycle methods to be recognized.
If in future if you want to move away from these "unsafe" lifecycle methods as fb is suggesting, I'd be willing to take a crack at it, you're okay with answering questions if I get stuck understanding the existing functionality?