Skip to content
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

Remove React.FunctionalComponent from component type definitions #608

Closed
nelsonni opened this issue Jan 24, 2022 · 1 comment · Fixed by #728 or #807
Closed

Remove React.FunctionalComponent from component type definitions #608

nelsonni opened this issue Jan 24, 2022 · 1 comment · Fixed by #728 or #807
Assignees
Labels
feature Feature requests or improvements
Milestone

Comments

@nelsonni
Copy link
Member

Is your feature request related to a problem? Please describe.
Recommendations through the CRA project (create-react-app), and approved by the React core maintainers, is to avoid using React.FC and React.FunctionComponent types.

Using these type definitions makes it confusing as to which components accept children, breaks generics, and really doesn't provide meaningful benefits; it's not even shorter syntax. See here for more details and discussion: facebook/create-react-app#8177

Describe the solution you'd like
For example, this:

const Component: React.FC<Props> = (props) => {

... can be replaced with this:

const Component = (props: Props) => {

Describe alternatives you've considered
N/A

Additional context
This information is also pinned within the semi-official Reactiflux Discord community, which is frequented by Redux, Redux-Saga, React-Bootstrap, RxJS, and other major React libraries.

@nelsonni nelsonni added the feature Feature requests or improvements label Jan 24, 2022
@nelsonni nelsonni modified the milestones: v1.0.0, v1.x.x Jan 24, 2022
@nelsonni
Copy link
Member Author

nelsonni commented Mar 7, 2022

Resolved as of 26cb704.

@nelsonni nelsonni self-assigned this Mar 8, 2022
@nelsonni nelsonni linked a pull request Apr 27, 2022 that will close this issue
5 tasks
@nelsonni nelsonni mentioned this issue Jun 7, 2022
@nelsonni nelsonni linked a pull request Jun 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests or improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant