where to store socket io instance react only when user is connected code example
Example: react receiving socket muitple times
socket.off('MY_EVENT').on('MY_EVENT', () => doThisOnlyOnce());
socket.off('MY_EVENT').on('MY_EVENT', () => doThisOnlyOnce());