current state react code example
Example 1: set state
setState({ searchTerm: event.target.value })
Example 2: reading state react
<button onClick={() => this.setState({ count: this.state.count + 1 })}>
Click me
</button>
setState({ searchTerm: event.target.value })
<button onClick={() => this.setState({ count: this.state.count + 1 })}>
Click me
</button>