react-lifecycle-methods-diagram
react-lifecycle-methods-diagram copied to clipboard
Add hooks lifecycle
This is to add the hooks lifecycle. This is inspired by: https://github.com/donavon/hook-flow (which was approved by Dan Abramov)
https://www.ReactAcademy.ca is distributing this as a handout to students, so I thought it would be cool to give back to the community.
This will wreck the translation, since I added a few strings. But I thought it would be worth it.
Wow, that's quite something! Thank you!
The only thing I don't like is our version switcher. It doesn't make sense anymore. I need to give i a thought how to do it.
Perhaps under version switcher, after we choose ^16.8, there could be tabs showing two diagrams: lifecycle methods and hooks? 🤔
As you saw, I just "squashed" a few commits together.
A lot of the "unrelated" changes (line separators, etc) were "forced" on the code because I'm using the Prettier extension on VS Code. (Thanks for cleaning that out!)
You are right, the version picker is kind of obsolete.
This is my take: The three unsafe lifecycle methods: componentWillMount componentWillReceiveProps componentWillUpdate
These are still part of React 16.2. They were only marked as UNSAFE from React 16.3.
Also, getDerivedStateFromProps was only introduced from 16.3, and "bugfixed" in 16.4.
https://reactjs.org/blog/2018/05/23/react-v-16-4.html#bugfix-for-getderivedstatefromprops
I would not document something that is now considered a "bug" from version 16.3.
We aren't documenting the old unsafe Methods from 16.2. Why should we do the same with a bug from 16.3?
Also, that bug was fixed rapidly. Between version 16.3 and 16.4, there's only 55 days. Not even two months. And it's been more than a year that it has been fixed.
So that means that the version "picker" could now simply be "class lifecycle" and "hooks lifecycle". Let's just remove 16.3.
Since I know French, I localized the strings to French. Other languages will have to be localized (by other folks).
Hello there. I would like to help with this PR moving into master. And then add Ukrainian localization. Why this freezing? PR no longer maintained?
I need a substantial amount of time to figure out and code the navigation, or perhaps splitting this into a separate app completely.
Is this going any further? Seeing as this is a very common lifecycle reference, it would be great to add the hooks version. A toggle-able option between hooks and class based component would work well I think, which i'm happy to implement if that sound suitable? @wojtekmaj
Since there are 0 commits (somehow) in this PR I'm gonna close this one.
As previously stated, I think a hook-only fork is more suitable for this.