Skip to content

Instantly share code, notes, and snippets.

@ypcode
Created January 3, 2019 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypcode/e684899943a91b28ddfa6cd42fae3a2b to your computer and use it in GitHub Desktop.
Save ypcode/e684899943a91b28ddfa6cd42fae3a2b to your computer and use it in GitHub Desktop.
// ...
import CustomPanel, { ICustomPanelProps } from "./components/CustomPanel";
import { sp } from "@pnp/sp";
import { autobind, assign } from '@uifabric/utilities';
// ...
const LOG_SOURCE: string = 'CustomFormPanelCommandSet';
export default class CustomFormPanelCommandSet extends BaseListViewCommandSet<ICustomFormPanelCommandSetProperties> {
private panelPlaceHolder: HTMLDivElement = null;
@override
public onInit(): Promise<void> {
Log.info(LOG_SOURCE, 'Initialized CommandSetWithPanelCommandSet');
// Setup the PnP JS with SPFx context
sp.setup({
spfxContext: this.context
});
// Create the container for our React component
this.panelPlaceHolder = document.body.appendChild(document.createElement("div"));
return Promise.resolve();
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment