Nighttime Peanut Migrations

    react-lifecycle-hoc

    3.1.0 • Public • Published

    react-lifecycle-hoc

    Higher-order components of react lifecycle.

    Travis Codecov Status npm package npm downloads license

    Dependency Status devDependency Status peerDependency Status

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

    CHANGELOG

    LICENSE

    MIT: http://michaelhsu.mit-license.org

    Install

    npm i react-lifecycle-hoc

    DownloadsWeekly Downloads

    3

    Version

    3.1.0

    License

    MIT

    Last publish

    Collaborators

    • evenchange4