How do I iterate through a React component's children in Typescript tsx?
The following would be valid jsx:
public render() {
return (
<div>
{React.Children.map(this.props.children, x => x.props.foo)}
</div>
);
}
However, in Typescript, the type of x is React.ReactElement<any>
so I have no access to props. Is there some kind of casting that I need to do?