Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

139
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda