SPFX init pnpjs

SPFX init pnpjs

2021/06/24 Office 365 SharePoint 0
import { sp } from "@pnp/sp/presets/all";

public onInit(): Promise<void> {
    return super.onInit().then(_ => {
      // other init code may be present
      sp.setup({
        spfxContext: this.context
      });
    });
  }

Leave a Reply

Your email address will not be published.