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_)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    3
  • 0.0.2
    1
  • 0.0.1
    701

Package Sidebar

Install

npm i react-renderif-hoc

Weekly Downloads

170

Version

0.0.3

License

MIT

Unpacked Size

2.39 kB

Total Files

5

Last publish

Collaborators

  • wellguimaraes