Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
¿Cómo puedo enviar texto tomado del usuario a otra pantalla para mostrarlo en <text> en reaccionar nativo? (Soy un principiante)
**App.js** function App() { const[getScreen, showScreen] = useState(false); const[getEmail, setEmail] = useState(""); return ( <View> <LoginScreen/> <LoginContexts.Provider value={{getEmail,setEmail,getScreen,showScreen}}> {showScreen ? < Screen2/> : < LoginScreen /> </LoginContexts.Provider> </View> ); } export default App; **Login** function LoginScreen ({navigation}){ const {getEmail,setEmail, showScreen} = useContext(LoginContexts); function gotEmail(inputEmail){ setEmail(inputEmail) } return( <View style={styles.container}> <Text style={styles.loginText}>Login</Text> <View style={styles.textInput}> <TextInput placeholder='Please enter your email' defaultValue={getEmail} onChange={gotEmail}/> </View> <View style={styles.space}/> <View style={styles.passwordStyle}> <TextInput placeholder='password' secureTextEntry autoCorrect={false} autoCapitalize='none' /> </View> <View style={styles.space}/> <View> <Button style={styles.loginBTN} title="Login" onPress={() => {showScreen(true)}} /> </View> </View> ); } export default LoginScreen; **Screen 2** function Screen2() { const {getEmail} = useContext(LoginContexts); return ( <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <Text>{getEmail}</Text>; </View> ); } export default Screen2; **LoginContext** <-- used context api import { createContext} from "react"; export const LoginContexts = createContext({});

¿Podría decirme por qué los datos no van a otra página? Usé useContext pero no puedo enviar datos a otra página. Por favor ayúdame a resolver este problema.

En esto, tomé la entrada del usuario como correo electrónico y quiero mostrar ese correo electrónico en la vista de texto en otra página, pero no puedo hacerlo. Al hacer clic en el botón, no pasa nada. por favor ayúdame

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda