Forum Discussion
kyleherrmann
Jul 26, 2021Copper Contributor
SPFx Web Context Returning Parent's Properties
I am developing a web-part for SharePoint Online using SPFx and the UI Fabric module.
Currently require the server relative Url of the SPWeb hosting the web-part so that I can make API calls to MS Graph, however the web context is returning its parent's values.
Therefore running
Alert(this.context.pageContext.web.serverRelativeUrl)
displays the Url of its parent, not the current web.
Struggling to find resources which address this, any help is much appreciated.
No RepliesBe the first to reply