2

On componentDidMount I have received the current logged in user using MSGraphClient. I have saved the object that I received from graph in fullObject variable.

I am using below code:

<NormalPeoplePicker
    onChange={this._onChange.bind(this)}
    onResolveSuggestions={this._onFilterChanged}
    getTextFromItem={(persona: IPersonaProps) => persona.primaryText}
    pickerSuggestionsProps={suggestionProps}
    className={'ms-PeoplePicker'}
    key={'normal'}
    itemLimit={1}
    selectedItems={this.state.fullObject}             
/>

How can I set this user as a default in the PeoplePicker field?

Any help would be greatly appreciated.

1 Answer 1

0

After component was rendered call another SP REST which change the state of the component and update like this:

<CompactPeoplePicker selectedItems={this.props.selectedItems} />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.