Weird react behaviour
I am rendering a element for every item inside of Root's children array, in that element i have a state to open or close the item (if its a dir). When someone opens a directory , i render a Nested Component that uses react query to fetch the contents of that directory and render them, and the nested component again renders the item (recursion goes on). This works fine in itself but when i have a zustand store that stores the current file and directory opened, the tree behaves in a very weird way.. the folders wont open even after multiple clicks and will randomly open on another click.
It seems like updating states is fine but when the component is re rendering coz of the state change, then its causing issues
https://pastebin.com/eJvbiirr
It seems like updating states is fine but when the component is re rendering coz of the state change, then its causing issues
https://pastebin.com/eJvbiirr
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.