Я пытаюсь передать state
между моими stacknavigation
экранами. Я настроил свой MainScreen props
с NavigationInjectedProps
.
Когда я отрисовываю свой props
, он говорит о свойстве 'id', 'title'
из undefined
.
Это мой код:
import * as React from 'react';
import {NavigationInjectedProps, withNavigation} from 'react-navigation'
import {Card} from 'react-native-elements'
interface Props extends NavigationInjectedProps {
blog:{
id:number,
title:string,
}
}
class RegisterAgreeScreen extends React.Component<Props, State>{
render() {
const { id } = this.props.blog;
return (
<View style={{backgroundColor:'red'}}>
<Card
id={id}>
</Card>
</View>
);
}
}
export default withNavigation(RegisterAgreeScreen);
Любая идея, что я сделал не так