-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
use_effect lacks documentation #3563
Comments
Do you have any ideas on what the documentation should be? I would be happy to look at any PRs updating the docs |
I would be happy to reach the level of understanding where I can submit doc PRs, but as you can see from this ticket I will need help to get there, and I expected answers to my questions would be part of that. What follows come from the small level of insights I could get, and as you see it brings additional questions. With a bit of step back, but without having still assimilated the whole stuff, my impression a lot of terminology about hooks is confusing, for example:
From what I gathered, I'd think that a few renamings could help newcomers greatly, eg.:
Another aspect that would also need more details is the use of "dependencies": many examples show In the case of Oh, and only when reading the example of |
This is about: Undocumented code
Problem
use_effect
is introduced in the tutorial and described in the API doc, with a new example.About its role the doc says "used for hooking into the component’s lifecycle", which is very vague: what does this sentence add to "called every time after the component’s render has finished"?
The doc only says "The callback is called every time after the component’s render has finished."
OTOH we see that in both examples the callback itself returns a callback, but nothing is said about this callback and when it gets called. Only a "tip" saying "The callback can return [()] if there is no destructor to run." hints that there it is likely a destructor (intended for what?). The examples themselves do not make it any more clear.
The text was updated successfully, but these errors were encountered: