react-huc

0.0.1 • Public • Published

React Huc

React Huc is a container

Install

$ npm install react-huc -S

usage

import Huc from 'react-huc'

<Huc initStore={{isShow: false}}>
 <Child1 />
 <Child2 />
</Huc>

//Child1
render() {
  const {isShow} = this.props
  return (
    <div>{isShow}</div>
  )
}

//Chil2

render(){
  const {isShow, dispatch} = this.props
  return (
    <div>
    <button onClick={()=> dispatch({isShow: !isShow})}>toggle</button>
    </div>
  )
}

Readme

Keywords

Package Sidebar

Install

npm i react-huc

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • ncysatnaf