GeekyAnts / react-pluggable

A plugin system for JS & React apps.
https://react-pluggable.github.io/
MIT License
172 stars 25 forks source link

Renderer.add should allow us to inject a component at the specified index #21

Open himanshu-satija opened 3 years ago

himanshu-satija commented 3 years ago

Currently it is not possible to inject a component at a specific index. It is just pushed to the end in the given slot.

this.pluginStore.executeFunction("Renderer.add", "header-right", () => <Button>Hello world!</Button>);

While we can achieve the required order by changing the order of installation of plugins, it is not the best way because the order of installation should be independent of the order of components in UI.

We need to be able to specify an index with this method.