0.2.2 • Published 8 years ago

react-lifecycle-decorators v0.2.2

Weekly downloads
173
License
MIT
Repository
github
Last release
8 years ago

Lifecycle decorators

Lifecycle decorators for stateless components

Installation

npm install -S react-lifecycle-decorators

componentWillMount(props)

const Component = ()=>(
    <div/>
);
export default componentWillMount(props=>props.fetchData())(Component);

shouldComponentUpdate(nextProps, props)

const Component = ()=>(
    <div/>
);
export default shouldComponentUpdate((nextProps, props)=>false)(Component);

componentWillUnmount(props)

const Component = ()=>(
    <div/>
);
export default componentWillUnmount(props=>props.somAction())(Component);

componentWillReceiveProps(nextProps, props)

componentWillUpdate(nextProps, props)

componentDidUpdate(prevProps, props)

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago