SPFX init pnpjs

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. Required fields are marked *