I am working on a project in react native where are multiple screens are added and it’s working as expected. But when i switch the network then initial call is returning me undefined and i am getting the error => Cannot read property “length” of undefined and app is getting crashed
This error comes randomly on any api.
Tried solution from internet but didn’t help. tried multiple steps to close it but still is not fixed yet.
Any suggestion would be appreciated.
I have tried adding the api code in try catch block but still i am getting the error in catch block but screen is getting crashed.
Guruprasad Saroj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.