title: How to change interval value in React
body: <p>I've tried changing the interval value when using ReactJs, but can't seem to get it to work. I've looked it up but haven't found anything useful (or maybe I didn't get to it while reading). I have most of my code inside a class component.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>class Timer extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
        tickS: 1000,
  
        ...
      };
    }
    componentDidMount() {
      this.intervalID = setInterval(
        () =&gt; this.tick(),
        this.state.tickS
      );
    }
    tick(){
      this.setState({
        ...
  
        tickS: 10**Math.log10(this.state.tickS + this.state.clicksChange),
  
        ...
      });
    }
  }
  </code></pre>
  
  <p>It does work for using <code>1000</code> milliseconds, but when i try to redefine the state of <code>tickS</code>, it doesn't work.</p>