react-renderif-hoc
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

react-renderif-hoc

A React HOC for conditional rendering

Install

yarn add react-renderif-hoc or npm i react-renderif-hoc

Usage

import { renderIf } from 'react-renderif-hoc'

function MyComponent_() {
  return <div>Hello world</div>
}

export const MyComponent = renderIf('show')(MyComponent_)
// or
export const MyAltComponent = renderIf(props => props.level > 1)(MyComponent_)

/react-renderif-hoc/

    Package Sidebar

    Install

    npm i react-renderif-hoc

    Weekly Downloads

    151

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    2.39 kB

    Total Files

    5

    Last publish

    Collaborators

    • wellguimaraes