This snippet differs from the existing TypeScript snippets by using the React.FunctionComponent generic interface.
I'd suggest improving the types of all TypeScript snippets by actually typing the constant that holds the React component, as has been done in this PR, not simply the props. Even the types of props is more correct when typed this way, since e.g. props.children is automatically typed by the React.FunctionComponent generic.
Hi,
Thanks for a great extension. I didn't find any contributing guidelines, so I hope it's okay to create a PR. Let me know if I've missed something.
tsrnfi
creates the following snippet:This snippet differs from the existing TypeScript snippets by using the
React.FunctionComponent
generic interface.I'd suggest improving the types of all TypeScript snippets by actually typing the constant that holds the React component, as has been done in this PR, not simply the props. Even the types of
props
is more correct when typed this way, since e.g.props.children
is automatically typed by theReact.FunctionComponent
generic.