-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
React.FC vs React.FunctionComponent #190
Comments
Since this cheatsheet is mostly aimed at beginners I would generally avoid abbreviations. But that doesn't mean we should recommend one over the other. I think using |
ah, i didnt know this recommendation had changed. it actually came from @ferdaber. yeah we should tell people both exist. thanks will address. |
Ah yeah my bad. I don't even recommend using either nowadays now that TypeScript supports namespace augmentation to functions. |
no worries man. glad to see you're doing ok :) |
@ferdaber Hi. I'm curious about "namespace augmentation to functions". Can you share some details?) Can't google it. 🤔 |
This change is what documents it, it allows you to assign properties of functions and arrow functions after they're declared and it updates the type of the function. This achieves the same functionality that you would get if you declare a function and a namespace with the same name. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#properties-declarations-on-functions |
yea i believe in general namespaces are on their way out in TS. at least for users, i believe its still relevant in library code. |
What cheatsheet is this about? (if applicable)
Basic cheatsheet
What's your issue or idea?
Last year some recommendations on using FunctionComponent instead of FC were added to this cheatsheet in #104.
But seems like things have changed since then and now these two types are identical. 🤔
The text was updated successfully, but these errors were encountered: