How to use children with React Stateless Functional Component in TypeScript?

Posted by Jessica Taylor | Updated on

Want to use children with React Stateless Functional Component in TypeScript? React 16.8 Update: Since React 16.8, the names React.SFC and React.StatelessComponent are deprecated. Actually, they have become aliases for React.FunctionComponent type or React.FC for short.

For now, you can use the React.StatelessComponent<> type, as:

For a component with your own custom props (like MyProps interface):


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers