0

I have the following code inside my .ts file in SPFx web part:-

export default class DocumentsViewerWebPart extends BaseClientSideWebPart<IDocumentsViewerWebPartProps> {
  private _themeProvider: ThemeProvider;
  private _themeVariant: IReadonlyTheme | undefined;

  protected async onInit(): Promise<void> {
    this.setTheme();

    await super.onInit();
  }

  /**
   * Update the current theme variant reference and re-render.
   *
   * @param args The new theme
   */
  private _handleThemeChangedEvent(args: ThemeChangedEventArgs): void {
    this._themeVariant = args.theme;
    this.render();
  }

  public render(): void {
    const element: React.ReactElement<IDocumentsViewerProps> = React.createElement(DocumentsViewer, {
      context: this.context,
      groupByColumn: this.properties.groupByColumn,
      themeVariant: this._themeVariant,
      connectToSiteUrl: this.properties.connectToSiteUrl,
      connectToListTitle: this.properties.connectToListTitle,
      listTitleForFolderIcons: this.properties.listTitleForFolderIcons,
    });

but i am getting these reference errors:-

Property 'context' does not exist on type 'DocumentsViewerWebPart'.

Property 'properties' does not exist on type 'DocumentsViewerWebPart'

Property 'domElement' does not exist on type 'DocumentsViewerWebPart'.

Any advice? Thanks

1 Answer 1

0

I hope, you have already solved this. For the people who need it that my solution is run -> npm i

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.