import React , { Component } from 'react' ; type Props = { type : 'foo' ; foo : 'blah' | 'wat' ; } | { type : 'bar' ; bar : string ; } ; class Test extends Component < Props > { render ( ) { return null ; } } const App = ( ) => ( < > { } < Test type = "foo" / > ; { } < Test type = "bar" / > < />);