title: Cannot read property of null - react.js state
body: <p>I'm trying to make a todo list app with React and Firebase.</p>
  
  <p>It's a single page app (except for login).
  In my Page's component, I call to a List's component.
  In my List's component, I get my firebase data that I put in a state.
  In React Dev Tool, in my List's component, I can see a state like this : </p>
  
  <pre><code>list{items{...},listName:"exemple"}
  </code></pre>
  
  <p>So, in my return, I'm trying to show the listName's value like that: <code>{this.state.list.listName}</code>
  But I have the following error: : Cannot read property <code>'listName'</code> of null </p>
  
  <p>This is my List's component :</p>
  
  <pre><code>  class ListPage extends Component {
        constructor(props) {
      super(props);
  
      this.state = {
        list: null,
      };
        }
        componentDidMount() {
      this.listRef = db.ref(`users/${this.props.user.uid}/lists
      ${this.props.cle}`);
      this.listRef.on('value', data=&gt;{
          this.setState({
              list: data.val()
          })
      })
      }
       render() {
      return (
        &lt;div&gt;
          &lt;h1&gt;List : {this.state.list.listName}&lt;/h1&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>
  
  <p>Where I am wrong ?</p>
  
  <p>Thanks </p>