navigating to component twice giving error for setstate

97 views Asked by At

I have a small application in react-native with two components. on Navigating to a component twice this gives me error for setState function. Anybody have idea about this . I am using native base as an starter kit for my project. the only change I did is I have seperated the UI render part in different js file. Thanks in advance.

1

There are 1 answers

5
james andy On BEST ANSWER

this has something to do with your render function. the setstate function gives error when there is no such state variable available. may be on navigating again to that same screen it is giving you a new state for that page instead of the previous state. Please check your render function.