title: Expected an assignment or function call error using the componentdidmount function
body: <p>I am trying to build a timer component such that it would tick only if a boolean isRunning variable is true. It's kind of similiar to the react basic tutorial:
  <a href="https://reactjs.org/docs/state-and-lifecycle.html" rel="nofollow noreferrer">https://reactjs.org/docs/state-and-lifecycle.html</a></p>
  <p>But for some reason my didmount function returns an error &quot; Expected an assignment or function call and instead saw an expression&quot;.</p>
  <p>If can someone tell me what I'm doing wrong it would be great.</p>
  <p>Here is my code:</p>
  <pre><code>import React , { Component } from 'react';
  
  class Timer extends Component {
      constructor (props) {
          super(props);
          this.state = {
              count : 0
          }
      }
  
  
      componentDidMount() {
          {
              {this.props.isRunning ? this.myInterval = setInterval(() =&gt; 
                  { this.tick()}, 1000) : null}
          }
      }
  
      tick() {
          this.setState({
              count: this.state.count + 1
          })
  
      }
  
      
      render () {
          {
              var hour = Math.floor(this.state.count/3600),
              minutes = Math.floor((this.state.count - hour*3600)/60),
              seconds = (this.state.count - hour*3600 -minutes*60 ),
              temp = new Date(); 
              temp.setHours(hour, minutes, seconds);
          }
          
          return(
              &lt;div&gt;
                  {temp.getHours()}:{temp.getMinutes()}:{temp.getSeconds()}
              &lt;/div&gt;
          );
      }
  }
  
  export default Timer;
  </code></pre>
  <p>I am 100% sure the problem arises due to my ComponentDidMount function.</p>