(hoc-factory target-fulcro-class hoc)
Returns a (fn [parent-component props & children] ...) that will render the target-fulcro-class, but as
wrapped by the hoc
function.
Use this when you have a JS React pattern that tells you:
var WrappedComponent = injectCrap(Component);
where injectCrap
is the hoc
parameter to this function.
Any injected data will appear as :injected-props
(a js map) in the computed parameter of the target Fulcro component.
You can this use the function returned from hoc-factory
as a normal component factory in fulcro.
Returns a (fn [parent-component props & children] ...) that will render the target-fulcro-class, but as wrapped by the `hoc` function. Use this when you have a JS React pattern that tells you: ``` var WrappedComponent = injectCrap(Component); ``` where `injectCrap` is the `hoc` parameter to this function. Any injected data will appear as `:injected-props` (a js map) in the computed parameter of the target Fulcro component. You can this use the function returned from `hoc-factory` as a normal component factory in fulcro.
(hoc-wrapper-factory component-class)
Creates a React factory (fn [parent fulcro-props & children])
for a component that has had an HOC applied,
and passes Fulcro's parent/props through to 'fulcro_hoc$parent' and 'fulcro_hoc_childprops' in the js props.
See hoc-factory, which is more likely what you want, as it further wraps the parent context for proper interop.
Creates a React factory `(fn [parent fulcro-props & children])` for a component that has had an HOC applied, and passes Fulcro's parent/props through to 'fulcro_hoc$parent' and 'fulcro_hoc_childprops' in the js props. See hoc-factory, which is more likely what you want, as it further wraps the parent context for proper interop.
(react-factory js-component-class)
Returns a factory for raw JS React classes.
(def ui-thing (react-factory SomeReactLibComponent))
...
(defsc X [_ _]
(ui-thing {:value 1}))
The returned function will accept CLJS maps as props (not optional) and then any number of children. The CLJS props will be converted to js for interop. You may pass js props as an optimization.
Returns a factory for raw JS React classes. ``` (def ui-thing (react-factory SomeReactLibComponent)) ... (defsc X [_ _] (ui-thing {:value 1})) ``` The returned function will accept CLJS maps as props (not optional) and then any number of children. The CLJS props will be converted to js for interop. You may pass js props as an optimization.
(react-input-factory js-component-class)
Returns a factory for raw JS React class that acts like an input. Use this on custom raw React controls are controlled via :value to make them behave properly with Fulcro.
(def ui-thing (react-input-factory SomeInputComponent))
...
(defsc X [_ _]
(ui-thing {:value 1}))
The returned function will accept CLJS maps as props (not optional) and then any number of children. The CLJS props will be converted to js for interop. You may pass js props as an optimization.
Returns a factory for raw JS React class that acts like an input. Use this on custom raw React controls are controlled via :value to make them behave properly with Fulcro. ``` (def ui-thing (react-input-factory SomeInputComponent)) ... (defsc X [_ _] (ui-thing {:value 1})) ``` The returned function will accept CLJS maps as props (not optional) and then any number of children. The CLJS props will be converted to js for interop. You may pass js props as an optimization.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close