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

251
Vistas
TypeError: render is not a function. (In 'render(newValue)', 'render' is an instance of Object)
import{ React, useContext} from 'react';  
import { Button, View, Text } from 'react-native';  
import { NavigationContainer, useNavigation ,useRoute } from '@react-navigation/native';  
import { createNativeStackNavigator } from '@react-navigation/native-stack';  
import { LoginContexts } from '../Contexts/LoginContexts';  


function Screen2() {
  
  const {getEmail} = useContext(LoginContexts);
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <LoginContexts.Consumer >
        <Text>{getEmail}</Text>   
      </LoginContexts.Consumer> 
    </View>
  );
}

export default Screen2;

This is my consumer part is which I want to display the text which is present in getEmail in Text View. please help to solve this problem.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The issue is that LoginContexts.Consumer component expects a render function.

Context.Consumer

<MyContext.Consumer>
  {value => /* render something based on the context value */}
</MyContext.Consumer>

The useContext hook is the consumer, remove the LoginContexts.Consumer component.

function Screen2() {
  const {getEmail} = useContext(LoginContexts);
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Text>{getEmail}</Text>
    </View>
  );
}
about 4 years ago · Juan Pablo Isaza Denunciar
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