Posts

Showing posts with the label SPFx

SharePoint Framework (SPFx) - SharePoint Hackathon 2025

Image
 

Transforming Employee Experiences - SharePoint Hackathon 2025

Image
 

Kickoff - SharePoint Hackathon - 2025

Image
  Kickoff to Innovation: SharePoint Hackathon Launch  https://www.youtube.com/live/XtpB1bEH5oo https://aka.ms/SharePoint/Agents/Trial http://aka.ms/SharePointLookBook http://aka.ms/SharePointEvent http://aka.ms/spfx

SPFX error Object is possibly null while using this.domElement.querySelector

Image
This post is specific to how to oversome object is possibly null issue in SPFx. I have created one simple webpart to display SharePrice. On the fly, it is going to call API and get the value and display it inside the DIV tag. As simple as that.  Below the part of the HTML in the  render() method:         <div>             <h5>SharePrice</h5>             <div name="currprice"></div>           </div>         </div>           </section>` ;     this ._getSharePrice(); Below the line of code I used to display the dynamic share price  : this .domElement.querySelector( '#currprice' )?.textContent = `Current Price: $ ${ sharePrice } ` ; This throws me below error saying object is null. Even there is single DIV elememt, still the error exist.       ...

SharePoint Framework Reference Guide

SPFx stands for SharePoint Framework -  https://learn.microsoft.com/en-us/javascript/api/overview/sharepoint?view=sp-typescript-latest   Below are the packages of SPFx and we are using them while using SPFx framework for development in our day-to-day activities. .'@microsoft/decorators' - https://learn.microsoft.com/en-us/javascript/api/decorators?view=sp-typescript-latest '@microsoft/sp-core-library' - https://learn.microsoft.com/en-us/javascript/api/sp-core-library?view=sp-typescript-latest '@microsoft/sp-component-base package' - https://learn.microsoft.com/en-us/javascript/api/sp-component-base?view=sp-typescript-latest '@microsoft/sp-application-base package' - https://learn.microsoft.com/en-us/javascript/api/sp-application-base?view=sp-typescript-latest '@microsoft/sp-dynamic-data package' - https://learn.microsoft.com/en-us/javascript/api/sp-dynamic-data?view=sp-typescript-latest '@microsoft/sp-extension-base package' - http...