I am trying to use pnp.sp.web.hubSiteData on my SPFX code, my problem is that hubSiteData property is not showing or coming up I have installed pnpjs to my solution by running npm install sp-pnp-js --save. is there other library that I need to add or import?
1 Answer
The reason that web.hubSiteData()
method does not show up is that there is a missing @pnp/sp/hubsites
import:
import { IHubSiteWebData } from "@pnp/sp/hubsites";
Once you add this import to the script file, the autocomplete for the hubSiteData()
should start working.
pnp.sp.web.hubsitedata
is a method and not a property