set state in constructor reactjs code example Example: set state setState({ searchTerm: event.target.value })