reactjs / react.dev

The React documentation website
https://react.dev/
Creative Commons Attribution 4.0 International
10.97k stars 7.48k forks source link

Add React Lifecycle diagram to documentation #819

Open wldcordeiro opened 6 years ago

wldcordeiro commented 6 years ago

x-post from the main React repo https://github.com/facebook/react/issues/12633

I'd love to see this or something similar to it included in the documentation page for component lifecycles. I remember @gaearon sharing it and I've found it invaluable for quick reference

react-lifecycles

gaearon commented 6 years ago

@wojtekmaj

Want to experiment with embedding your component into the doc?

alexkrolick commented 6 years ago

@gaearon is there some kind of source document you could check in so it's easier to update?

wojtekmaj commented 6 years ago

My main concern at the moment is how can we handle mobile devices. That's pretty complicated diagram. I have created mobile layout version but I'm not satisfied with it so much.

seb-thomas commented 6 years ago

@wldcordeiro Hey do you know if that's the same diagram referenced here: https://reactjs.org/docs/react-component.html#the-component-lifecycle ?

The link on the docs is broken, if that's the same diagram would be good to rehost it, maybe in this repo, and change the link.

wojtekmaj commented 6 years ago

@plonko, I don't think the link is broken. It's actually my server, I keep it, I maintain it, I'll keep it in sync with wojtekmaj/react-lifecycle-methods-diagram repo and will continue to do so in the future.

If you have any issues with the diagram itself, i.e. not displaying correctly in your environment, I suggest you making an issue in the repo mentioned above. I keep track of it and will react (pun not intended) if needed.

divyanshu013 commented 5 years ago

This has been added here I think https://reactjs.org/docs/react-component.html#the-component-lifecycle