I have a SharePoint SPFx react webapp that I'm working on. I'm trying to get the SharePoint URL. For example:
https://mysite.sharepoint.com/sites/sitename/SitePages/Home.aspx#/
So I want to get https://mysite.sharepoint.com/sites/sitename
I've tried using references from here: Get Site Collection full URL using javascript and spfx-how-use-site-url-from-current-page-context-in-react-spfx-solution
The issue I'm having is I'm using the older sp-pnp-js
library so all the examples I found online reference the newer pnpJS library.
So this.context.pageContext.web.absoluteUrl
and spHttpClient
do not work with the older sp-pnp-js
library