Search code examples
react-nativeexceptionstack-overflow

Giving Stackoverflow Exception on input focus React-Native


i am new to react native and i'm having an exception when input field focus. This is the screen that have two tabs. Screen Code

and in the second tab i'm going to load list of data fetch from Rest API. This is where i got this exception

Component A

and here is the component that contains the input field with callback functions

Component B that imported to A

i am getting below exception when i press the input field to type something. Exception Screenshot


Solution

  • I came across the same issue, I did two things and the project did its magic I don't know the reason but it worked for me

    1. Changed all my functions to arrow functions
    2. initialized all my states by some value.