React native 在react native中使用NativeBase textArea

React native 在react native中使用NativeBase textArea,react-native,native-base,React Native,Native Base,嗨,我想有一个文本区,以便让用户在我的应用程序中发送评论消息。那么,如何检索用户使用组件编写的消息呢 render() { return ( <Container> <Content padder> <Item style = {{ marginBottom: 10}}> <Input placeholder="Email" />

嗨,我想有一个文本区,以便让用户在我的应用程序中发送评论消息。那么,如何检索用户使用组件编写的消息呢

  render() {
    return (
      <Container>
        <Content padder>
            <Item style = {{ marginBottom: 10}}>
                <Input placeholder="Email" />
            </Item>
            <Form style = {{ marginBottom: 20}}>
                <Textarea rowSpan={3} bordered placeholder="Votre message" />
            </Form>
            <Button success>
                <Text>Envoyer</Text>
            </Button>
        </Content>

      </Container>

    );
  }
render(){
返回(
特使
);
}

我希望能够得到电子邮件和用户的信息。谢谢

本机基本输入是react Native TextInput组件的扩展,因此可以使用
onChangeText
事件。 例如,假设我们的状态中有两个元素:电子邮件和消息<代码>{电子邮件:,消息:}

我们需要将onChangeText事件添加到两个输入中,如下所示:

<Input placeholder="Email" onChangeText={email => this.setState({email: email})} />
this.setState({email:email})}/>

this.setState({message:message})}/>
现在,您可以使用
this.state.email
this.state.message
检索用户编写的文本

请阅读和中的官方react native文档中有关处理文本输入的更多信息

 <Textarea rowSpan={3} bordered placeholder="Votre message" onChangeText={message=> this.setState({message: message})} />