@roadhump/hocs
v1.0.3
Published
Small useful HOCs based on recompose.
Downloads
16
Readme
@roadhump/hocs
Small useful HOCs based on recompose
renderIf()
renderIf(
test: (props: Object) => boolean,
Component: ReactClass | ReactFunctionalComponent | string
): HigherOrderComponent
Renders Component
if test
is true, otherwise default wrapped component.
renderNothingIf((props) => Boolean)
renderIf(
test: (props: Object) => boolean,
): HigherOrderComponent
Renders to null if test
is true, otherwise default wrapped component.
onMount
onMount(
func: (props: Object) => any,
): HigherOrderComponent
Run func
on componentDidMount
lifecycle handler.