0

I was wondering if there is a way in SPFX to get the library by the current url? Lets say "/sites/CustomerSite/Shared%20Documents/Forms/AllItems.aspx"

Bryan van Rijn
  • 837
  • 10
  • 18

1 Answers1

1

Below code works by @pnp/sp.

sp.web.getList("/sites/lee/Shared%20Documents/Forms/AllItems.aspx").get().then(data => {
      console.log(data);
  }).catch(err => {
      console.log(err);
  });
Lee
  • 5,305
  • 1
  • 6
  • 12