content
Use children with React stateless functional component in TypeScript
Here is how to get the props children in one of your functional components with Typescript. It is possible to pass other parameters as input as in our example below.
const MyComponent: React.FunctionComponent<MyComponentProps> = props => (
<div>
<p>{props.custom}</p>
<p>{props.children}</p>
</div>
);
Related snippets |
---|