And the same for the server instance
so initiating the server in useEffect in the required part of the app and store instance in global then reusing it across the full app.
it's known that it's not recommended to save values in global, also bad for typescript in react native
so any other recommended way, as is it safe to store it in a global state like zustand?
or some opinions mentioned initializing outside components and exporting instance and then importing it from file and use it.
Any recommended way of storing socket instance after creating for now I am storing it in global scope
And the same for the server instance so initiating the server in useEffect in the required part of the app and store instance in global then reusing it across the full app. it's known that it's not recommended to save values in global, also bad for typescript in react native so any other recommended way, as is it safe to store it in a global state like zustand? or some opinions mentioned initializing outside components and exporting instance and then importing it from file and use it.