Skip to main content

on componentDidMount i recieve with MSGraphClientOn componentDidMount I have received the current logedlogged in user using MSGraphClient.How can i set this user as a default in I have saved the PeoplePicker?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 fullObject i save the object that i recieve from graph.PeoplePicker field?

Any help would be greatly appreciated.

on componentDidMount i recieve with MSGraphClient the current loged user.How can i set this user as a default in the PeoplePicker?

 <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}             
     />

in fullObject i save the object that i recieve from graph.

Any help would be greatly appreciated.

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.

Source Link

SPFx Office UI React - How to default select user in People Picker

on componentDidMount i recieve with MSGraphClient the current loged user.How can i set this user as a default in the PeoplePicker?

 <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}             
     />

in fullObject i save the object that i recieve from graph.

Any help would be greatly appreciated.