I want to clear the values selected in a NormalPeoplePicker through a button click, but setting state controlled "defaultSelectedUsers" value to [] does not work:
<PeoplePicker
people={data.user}
title={"Users"}
onChange={handleChange}
defaultSelectedUsers={this.state.selectedPersons}
itemLimit={5}
onSearchPeople={handleSearch}
/>
<PrimaryButton
text={"Clear"}
onClick={() => {this.setState({selectedPersons: []}}
/>
Is there a way to achieve this??
Thanks!!
Change the defaultSelectedUsers to selectedUsers and set the value (selectedPersons) to a empty array.