how to update state in class component in react code example Example: set state setState({ searchTerm: event.target.value })