You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, would love some examples in Function Components section of What's the difference? each bullet points :)
Examples would be much better on these 2 bullet points since it makes grasping easier -
If you need to use children property inside the function body, in the former case it has to be added explicitly. FunctionComponent already includes the correctly typed children property which then doesn't have to become part of your type.
Typing your function explicitly will also give you typechecking and autocomplete on its static properties, like displayName, propTypes, and defaultProps
The text was updated successfully, but these errors were encountered:
You're welcome to make a PR with those changes! I think it's a good message to send as I personally never use the FunctionComponent annotation. It wasn't even until I became involved in this project that I realized people were using it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!
What cheatsheet is this about? (if applicable)
Basic cheatsheet
What's your issue or idea?
The function component can be reduced to
instead of
which is quite big & is weird syntactically at least in vanilla JS
Also, would love some examples in Function Components section of What's the difference? each bullet points :)
Examples would be much better on these 2 bullet points since it makes grasping easier -
The text was updated successfully, but these errors were encountered: