How to pass data from one component of React Native to another?

0
import Login from './Login';

export default class Perfilextends Component {

constructor(props) {
super(props);
this.state = { 
  username: '',
  password: '',
  }
}

render() {
  return (
  <KeyboardAvoidingView behavior="padding" style={estilos.contenedor}> 
 <ImageBackground source={require('../assets/img/fondo_pantalla.jpg')} style={estilos.FondoLogin} >


 <Image style={{width: winSize.width - 80, height: 100, marginTop: 100 }} source={require('../assets/img/logo_login.png')} resizeMode="contain"/>

    <View style={{width: winSize.width - 70}}>

      <Form>
        <Item floatingLabel stackedLabel>
          <Label><Text style={estilos.textoCampos}>Matrícula:</Text></Label>
          <Input onChangeText={(username) => this.setState({username})} 
          value={this.state.username} returnKeyType="next" style={{color: '#fff', marginBottom: -20}}/>
        </Item>
        <Item floatingLabel stackedLabel>
          <Label><Text style={estilos.textoCampos}>Password:</Text></Label>
          <Input onChangeText={(password) => this.setState({password})} 
          value={this.state.password} secureTextEntry={true} returnKeyType="go" style={{color: '#fff', marginBottom: -20}}/>
        </Item>
      </Form>

        </View>

    <TouchableOpacity style={estilos.btnLogin} onPress={this.boton}>
       <Text style={estilos.btnText}>INICIAR SESIÓN</Text>
    </TouchableOpacity>

   </ImageBackground>

</KeyboardAvoidingView > 
     );
       }
        }

I want to import data from the Login.js file

    
asked by Arnel Cariaga Jr. 01.03.2018 в 22:22
source

0 answers