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

147
Vistas
the navigation with two key is not working in react native

i have made a login and register pages with AUTH and it was working and after that ,I want to receive data from my database . so ,I change the if else statement after that the data match is working is not taking me to home page I tried some ways to fix it but it doesn't work error:Data Matched

so here we see the api is working my php code

my react code

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

0

The error message in the screenshot does not match the message from the condition.

Try to change the condition as shown below:


const {message} = responseJson;
if (typeof message === 'string' && message.toLowerCase().trim() === 'data matched') {
    // do navigation here
}

const oldVerify = (responseJson) => (responseJson === 'Data Matched');

const newVerify = (responseJson) => (typeof responseJson === 'string' && responseJson.toLowerCase().trim() === 'data matched');

const cases = ['Data Matched', 'Data matched', 'data MATCHED', '  data matched ', 'data matched'];

cases.forEach((_case) => {
  console.log('======');
  console.log(`Case: "${_case}"`);
  console.log('Old verify:', oldVerify(_case));
  console.log('New verify:', newVerify(_case));
});

I advise you to publish your code in plain text in the future :)

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