set state when a component renders code example Example: set state setState({ searchTerm: event.target.value })