Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!