关键思想是为
Example常量指定正确的类型。可能
react-navigation已经提供了该类型。但是,您也可以这样扩展内置
React接口:
interface NavStatelessComponent extends React.StatelessComponent { navigationOptions?: Object } const Example: NavStatelessComponent = () => { return ( <View> ... </View> ) } Example.navigationOptions = { } Example.propTypes = { }


