Sharepoint Framework SPFx - Pnp/PnPjs with React - Taxonomy Picker not working

Viewed 47

I have created the SPfx project with React. I have used @pnp/sp": "^3.. for interaction with SharePoint. I can successfully get data from the SharePoint lists and Libraries. Now, I need to get SharePoint taxonomy terms and it's the parent term of that term. I have tried as per below documentation but not able to get data.

https://pnp.github.io/sp-dev-fx-controls-react/controls/TaxonomyPicker/

State.ts

import { IPickerTerms } from "@pnp/spfx-controls-react/lib/TaxonomyPicker";
export interface ISpfxStateState {
  terms?: IPickerTerms;
}

txs file

    import { TaxonomyPicker, IPickerTerms } from "@pnp/spfx-controls-react/lib/TaxonomyPicker";
<TaxonomyPicker allowMultipleSelections={true}
              termsetNameOrID="45d2cbfb-54cc-4619-8cc7-b3ee8d03f10a"
              panelTitle="Select Year"
              label="Year"
              context={this.props.context}
              onChange={this.onTaxonomyPickerChange}
              isTermSetSelectable={false} required />[enter image description here][1]
1 Answers

I am also in the same boat as you actually. Trying to retrieve a term set and it never returns anything. The web part is just stuck loading forever.

Related