react-mapper

1.0.0 • Public • Published

React Mapper

build a react component which render different components by props

Installation

npm install react-mapper --save

Usage

import mapper from 'react-mapper'

const CompA = (props) => {...};
const CompB = (props) => {...};

// inside CompC, it will render CompA only if props.useA === true
const CompC = mapper(props=>props.useA ? CompA : CompB)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.01latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.01

Package Sidebar

Install

npm i react-mapper

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • zhaoyao91