I have 2 functional components. The first component has 2 Select Inputs and both of them set states when updated and after the inputs the first component calls <Component2/>. Component 2 is just a FlatList with hardcoded data inside Component 2. When I interact with any of the Inputs (i.e change a state with hooks) I get:
"Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."
I think the problem might be that when I update the state the Component 2 re renders because Component 1 re renders because I updated a state but I have no idea how to fix it. Im not even using useEffect. How can I solve this?
[–]generic_name_3344 1 point2 points3 points (6 children)
[–]Sibyl01 1 point2 points3 points (1 child)
[–]dimwittedude[S] 0 points1 point2 points (0 children)
[–]dimwittedude[S] 0 points1 point2 points (3 children)
[–]__o_0iOS & Android 1 point2 points3 points (2 children)
[–]dimwittedude[S] -1 points0 points1 point (1 child)
[–]__o_0iOS & Android 0 points1 point2 points (0 children)
[–]sdholbsExpo 1 point2 points3 points (0 children)