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

React.StatelessComponent => React.FC #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fedorovsky
Copy link

Hello Josh Johnston,

I have proposed a change in the React component types in your library, switching from React.StatelessComponent to React.FC. This change was made for the following reasons:

Deprecation of React.StatelessComponent: As of React 16.8, the alias React.StatelessComponent has been deprecated. This is because React no longer strictly divides components into "stateful" and "stateless" ones. Instead, all components can now use hooks, making the distinction between StatelessComponent and Component less significant.

Transition to React.FC:
React.FC or React.FunctionComponent provides clearer and more modern conventions for defining functional components. It includes proper default children definitions, and allows for the use of propTypes and defaultProps in a typed manner.
These changes make the code cleaner and more maintainable, and also enhance compatibility with current and future versions of React. I would appreciate it if you consider this change for inclusion in the main branch of your project.

Best regards,
Anton Fedorovskyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant