react-lifecycle-hoc
v3.1.0
Published
Higher-order components of react lifecycle.
Downloads
69
Maintainers
Readme
react-lifecycle-hoc
Higher-order components of react lifecycle.
Installation
$ npm install react-lifecycle-hoc --save
Usage
- As HOC
import { componentDidMount } from 'react-lifecycle-hoc';
componentDidMount(
({ props }) => console.log(props),
)(() => <div/>);
- ES7 decorator
@componentDidMount(callback)
class Container extends React.Component {
render() {
return <div/>;
}
}
API
componentDidMount(
callback: (this: Object) => void,
): HigherOrderComponent
Test
$ npm run lint
$ npm run test:watch
CONTRIBUTING
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests (
$ npm test
).