-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
This is about:
- Undocumented code
Problem
Add a diagram of the component lifecycle under 'Lifecycle' in the docs.
This issue was originally started in the yewstack/docs - Original issue. I'm just moving it over here as that repo is now archived (as proposed in #1421).
For convenience I'll just echo the original proposal below:
Render Cycle1
- create()
- view()
- yew renders to page
- mounted()
Note: should explain how children components are rendered.. (Parent view -> Child view -> Child mount -> Parent mount)
Update Cycle1
- trigger event / callback / send message
- update()
- (optional) view()
- yew renders to page
Change Cycle1
- render component with new props
- change()2
- (optional) view()
- yew renders to page
1 - Note made in original issue: "'Change cycle' and 'update cycle' should be altered slightly because they're not 'cycles' as such."
2 - In the original issue this is 'update()' which was a typo, change() is the correct method.
As noted in the original issue the diagram should be in SVG (rather than a PNG etc) as it would offer better resolution.