Spfx 2019 pnp/spfx-controls-react

vikram bhardwaj 1 Reputation point
2020-12-11T11:11:52.533+00:00

47373-spfx-2019.png

Hi team

i have worked sharfepoint 2019,i had npm install @pnp/spfx-controls-react --save --save-exact in spfx project.then come error in Error - typescript - node_modules/@pnp/sp/appcatalog/types.d.ts(29,33): error TS1110: Type expected..what will be do in spfx react pnp controll. what is issue then tell

Microsoft 365 and Office | SharePoint Server | For business
Windows for business | Windows Server | User experience | Other
{count} votes

2 answers

Sort by: Most helpful
  1. MichaelHan-MSFT 18,126 Reputation points
    2020-12-14T09:50:01.913+00:00

    Hi @vikram bhardwaj ,

    Per my test, I could reproduce your issue on my end. This due to the version of @pnp/spfx-controls is not supported in SharePoint 2019 framework.

    In fact, the command npm install @pnp/spfx-controls-react --save --save-exact will install the latest version @pnp/spfx-controls-react V2. V2 Supports SharePoint Online only. We have to use v1 to deploy solutions on SharePoint 2019 : https://pnp.github.io/sp-dev-fx-controls-react/guides/migrate-from-v1/

    To install @pnp/spfx-controls-react v1, you could use this command instead:

    npm i @pnp/spfx-controls-react@1.19.0  
    

    Reference: https://www.npmjs.com/package/@pnp/spfx-controls-react/v/1.19.0


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. MichaelHan-MSFT 18,126 Reputation points
    2020-12-21T08:43:18.77+00:00

    Hi @vikram bhardwaj ,

    Per my test, the people picker works on my end.

    Install @pnp/spfx-controls-react v1 as I mentioned:

    npm i @pnp/spfx-controls-react@1.19.0  
    

    You could check the version of @pnp/spfx-controls-react in package.json file:

    49907-image.png

    Import the following modules to your component:

    import { PeoplePicker, PrincipalType } from "@pnp/spfx-controls-react/lib/PeoplePicker";  
    

    Use the PeoplePicker control in your code as follows:

         <PeoplePicker  
          context={this.props.context}  
          titleText="People Picker"  
          personSelectionLimit={3}  
          showtooltip={true}  
          isRequired={true}                
    
          showHiddenInUI={false}  
          principalTypes={[PrincipalType.User]}  
          resolveDelay={1000} />  
    

    49837-image.png

    Test result:

    49914-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.