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.

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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