-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[ui] Eliminate React.FC #17446
[ui] Eliminate React.FC #17446
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
Deploy preview for dagit-storybook ready! ✅ Preview Built with commit 8bf8831. |
9e1218a
to
435d152
Compare
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit 8bf8831. |
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
types: { | ||
'React.FC': | ||
'Useless and has some drawbacks, see https://github.com/facebook/create-react-app/pull/8177', | ||
'React.FunctionComponent': | ||
'Useless and has some drawbacks, see https://github.com/facebook/create-react-app/pull/8177', | ||
'React.FunctionalComponent': | ||
'Preact specific, useless and has some drawbacks, see https://github.com/facebook/create-react-app/pull/8177', | ||
}, | ||
}, | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint guardrail
435d152
to
7dfe7fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Thanks for linking out to the docs, I had heard that this was not preferable anymore (was it ever?) but reading the full list of reasons in that issue is great. RIP React.FC!
7dfe7fc
to
8bf8831
Compare
Summary & Motivation
Remove React.FC from JS packages, some by hand but mostly using https://github.com/gndelia/codemod-replace-react-fc-typescript.
In some places, I went in and manually tidied things to prevent huge whitespace shifts, especially around
React.memo
.How I Tested These Changes
TS, lint, jest.