InjectedComponentSet

Summary

InjectedComponent makes it easy to include a set of dynamically registered components inside of your React render method. Rather than explicitly render an array of buttons, for example, you can use InjectedComponentSet:

<InjectedComponentSet className="message-actions"
                  matching={role: 'ThreadActionButton'}
                  exposedProps={thread:@props.thread, message:@props.message}>

InjectedComponentSet will look up components registered for the location you provide, render them inside a {Flexbox} and pass them exposedProps. By default, all injected children are rendered inside {UnsafeComponent} wrappers to prevent third-party code from throwing exceptions that break React renders.

InjectedComponentSet monitors the ComponentRegistry for changes. If a new component is registered into the location you provide, InjectedComponentSet will re-render.

If no matching components is found, the InjectedComponent renders an empty span.

Class Properties

propTypes

React `props` supported by InjectedComponentSet:

matching Pass an {Object} with ComponentRegistry descriptors This set of descriptors is provided to ComponentRegistry::findComponentsForDescriptor to retrieve components for display.
matchLimit Optional A {Number} that indicates the max number of matching elements to render
className Optional A {String} class name for the containing element.
children Optional Any React elements rendered inside the InjectedComponentSet will always be displayed.
onComponentsDidRender Callback that will be called when the injected component set is successfully rendered onto the DOM.
exposedProps Optional An {Object} with props that will be passed to each item rendered into the set.
containersRequired Optional . Pass false to optionally remove the containers placed around injected components to isolate them from the rest of the app.
Any other props you provide, such as `direction`, `data-column`, etc. will be applied to the {Flexbox} rendered by the InjectedComponentSet.

results matching ""

    No results matching ""