Updating React state with Immutable
<p>I'm trying to update my regular React state through Immutable, and got into some few issues. The state isn't deeply nested or it isn't nested from anything other than the state itself, such as <code>{ "username" : "keyval" : null}}</code></p>

<p>This means I could not do something such as <code>username.update('keyval', something)</code>, instead I need another approach. Its a rather easy question, I just don't know how to do it. Here's how my setState looks like, which I want to make an Immutable setState action. </p>

<pre><code>handleUpdatePassword(event) {
    event.persist()
    this.setState(({password}) =&gt; ({
      password: state.update('password', event.target.value)
      })
    );
  }
</code></pre>

<p>And here is the error I get when trying:</p>

<pre><code>   handleUpdatePassword(event) {
        event.persist()
        this.setState({
          password: state.update('password', event.target.value)
          })
      }
</code></pre>

<p><a href="https://i.stack.imgur.com/cMXw8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cMXw8.png" alt="sad"></a>
Also, This works, but I get this error: <code>this.state.updater is not a function</code></p>

<pre><code>handleUpdateUsername(event) {
    console.log(this.state)
    event.persist()
    this.setState({
      username: this.state.update('username', event.target.value)
      })
  }
</code></pre>