socket react cannot access state before initialization code example Example: Cannot access 'stats' before initialization Cannot access 'stats' before initialization