React components that work with redux-plugins-immutable
npm install redux-plugins-immutable-reactReact helper components for redux-plugins-immutable
```
npm install redux-plugins-immutable-react
These components help you inject other components from plugins into your UI. There are two helpers:
- LoadPluginComponent: renders a component from a plugin, loading the plugin if necessaryPluginComponents
- : renders multiple components from multiple plugins
Renders a component from a plugin, loading the plugin if necessary. It will also render loading and load error messages
depending on the plugin status.
#### propTypespluginKey
- (string|Symbol): the key of the plugin to load the component fromcomponentKey
- (?string|Symbol): if given, will get the component/element atstore.getState().getIn(['plugins', pluginKey, 'components', componentKey])getComponent
- ((plugin: Immutable.Map) => any): (overrides componentKey) if given, gets the component/elementplugin
from the from the redux state.componentProps
- (Object): if given, the component/element will be created/cloned with these propschildren
- : ((state: {loading: boolean, loadError?: Error, component?: any): if given, LoadPluginComponent willrender()
return the result of this function from its instead of its default behavior.
#### contextTypesLoadPluginComponentSkin
- (React.Component): component to render the plugin status or component. It will be createdpluginName
with the following props:
- (string): the plugin nameloading
- (boolean): whether the plugin is loadingloadError
- (Error): the error if the plugin failed to loadchildren
- (?React.Element): the plugin component if found
Renders multiple components from multiple plugins. It will not load any plugins that are not loaded.
#### propTypescomponentKey
- (?string|Symbol): if given, will get plugin.getIn(['components', componentKey]) for each pluginstore.getState().get('plugins')
in . The value at these locations must be a React component, element, or anArray|Immutable.List of components/elements.getComponent
- ((plugin: Immutable.Map) => any): (overrides componentKey) if given, gets the component/elementplugin
from the from the redux state. It may return a React component, element, or an Array|Immutable.List ofcomponentProps
components/elements.
- (Object): if given, each component/element will be created/cloned with these propschildren
- ((pluginComponents: any[]) => ?React.Element): if given, PluginComponents will return the result ofrender()
this function from its instead of rendering pluginComponents inside a