React.StatelessComponent => React.FC #198
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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