title: React js Objects are not valid as a React child
body: <p>I am trying to make a socket connection to my backend through my front end, but sme successfully</p>
  
  <p>I declared my socket in my state and then opened the connection, but I don't know why this error:</p>
  
  <p>code:</p>
  
  <pre><code>class App extends Component {
    constructor(props, context){
      super(props, context);
      this.state = {
        queue: '',
        socket: null
    };
    }
    componentDidMount() {
      // io() not io.connect()
      this.state.socket = io('http://localhost:9000');
  
      this.state.socket.on('queue', (queue) =&gt; {
        this.setState({
          queue
        })
      });
  
      this.state.socket.open();
    }
  
    componentWillUnmount() {
      this.state.socket.close();
    }
      render() {
          return (
              &lt;div&gt;
                 &lt;p&gt; Queue: {this.state.queue}  &lt;/p&gt;
              &lt;/div&gt;
          )
      }
  }
  </code></pre>