亲爱的,
我想将pid.js屏幕中的输入值传递给屏幕上的更多 我该怎么办??
我使用导航将其传递到服务页面并完成了 但现在我想将其传递到另一个页面
class Pid extends Component {
constructor(props) {
super(props);
this.state = {text: ''};
}
render() {
const { navigate } = this.props.navigation
return (
<View style={{ flex: 1 }}>
<FormInput placeholder={"PID"} onChangeText={(text) => this.setState({text})} />
<Button title='next'
onPress={() => navigate('service', { text: this.state.text})} >
</Button>
</View>
);
}
}
export default Pid;
答案 0 :(得分:0)
如果我知道,您需要这个吗?
render() {
const { navigate } = this.props.navigation
return (
<View style={{ flex: 1 }}>
<FormInput placeholder={"PID"} onChangeText=.
{(text) => this.setState({text})} />
<Button title='next'
onPress={() => navigate('service', { text: this.state.text})} >
</Button>
<Button title='next'
onPress={() => navigate('service2', { text: this.state.text})} >
</Button>
</View>
);