react setstate how to update correct way code example Example: set state setState({ searchTerm: event.target.value })