4

Within our product we have created an SPFx extension to show a navigation component on the top of our modern pages. Additional to this navigation component we want to show a button which opens an Fabric UI Panel on the page. In this Panel we want load an SPFx webpart from another SPFx solution. This Panel is loaded in the SPFx extension, so what I'm really asking is:

Can I show an SPFx WebPart from another solution (we'd actually like to make this configurable to re-use it with other webparts) within an SPFx Extension?

1

An SPFx solution (and its webparts) are isolated from the rest and is bundled as such.

What you could do is create a "common" package, which has the actual component(s) you want to render, and then reference this both in your Extension solution and your WebParts solution.

  • That's indeed what I was thinking too. Thanks for the confirmation! My problem is that to do this I will have to host this package somewhere (which could off course be the same cdn location as the spfx components) and create some kind of versioning system for this myself to keep it easy to update. Or does SharePoint provide such a thing besides the SPFx components? – pkmelee337 May 16 '18 at 22:03
  • SharePoint doesn't really, no. Hosting the file could be part of your deployment procedure, and could easily be hosted within sharepoint itself, or azure cdn. – Nsevens May 22 '18 at 7:02
1

What we have done to get around this is to have our own npm server. We can then reference any useful component in either an Extension or a Web Part. Unfortunately you can't really just 'use' a Web Part due to the 'this' context being wildly different and having no options for prop-panes in the same way.

Hopefully this is something they fill in a little at some point with the framework.We have also found some use for Dyn Data in other situations but unfortunately can't help you here.

NPM Server

Dynamic Data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.