-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Add documentation about empty functional components #6419
Conversation
This is fixed in v15 (stateless function components can now return null). I'm going to close this out because we are in the process of shipping v15 and by the time this got merged and cherry-picked over, we'd already be on v15 and would have to do another PR to remove this note. If you're interested, this was fixed in: #5884 The note is great. Just the timing is wrong. A month or two ago, we would gladly have accepted this PR! |
Do you think it might make sense to have some docs about this and just call out that it only applies in v0.14 but 15 does work? I think we're somewhat likely to see reports from people still using 14 but reading the 14 docs and getting the wrong idea. |
Yeah, alright, I could get behind that. |
@IvanVergiliev Can you update the note to indicate that this applies to v0.14, and that this was fixed in v15 such that stateless functions can now return null. Perhaps:
|
Thanks for the quick response! Happy to hear this is possible now. I also think it's a good idea to include it in the docs as I was in the process of updating 2048-react but decided to do it version by version so I can better see what changed. Without such a note (or this discussion) it would've been a while before I understood I can actually return |
Add documentation about empty functional components (cherry picked from commit 62f64a8)
The dev build has a warning about this, but there's no obvious course of action to actually make it work. Also, I think adding this to the docs makes migrating existing components easier.