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