I have a react component like
const Example = () => (<View>...</View>);
Using react-navigation I would normally apply navigation options by saying
Example.navigationOptions = { options };
With typescript I am getting the error
[ts] Property 'navigationOptions' does not exist on type '(props: Props) => Element'.
How can I fix this?
I tried writing an interface
interface ExampleWithNavigationOptions extends Element {
navigationOptions?;
}
But with no luck.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…