Today I Learned

hashrocket A Hashrocket project

Use react component prop in TypeScript

Use JSX.Element when you want to accept a component as a prop:

interface Props {
  rightContent: JSX.Element;
}

class Content extends Component {
  render() {
    <Row>
      <Text>Hi There</Text>
      <RightContent>{this.props.rightContent}</RightContainer>
    </Row>
  }
}
See More #react TILs
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.