Permalink
7308b6b Mar 4, 2018
1 contributor

Users who have contributed to this file

34 lines (24 sloc) 623 Bytes

<Lifecycles>

Inverts life-cycle methods.

Usage

import {Lifecycles} from 'libreact/lib/Lifecycles';

<Lifecycles didMount={() => console.log('Component did mount!')}>
  Hello world!
</Lifecycles>

Props

Signature.

interface ILifecyclesProps {
  willMount?: (props) => void;
  didMount?: (props) => void;
  willReceiveProps?: (nextProps, props) => void;
  shouldUpdate?: (nextProps, props) => boolean;
  willUpdate?: (nextProps, props) => void;
  didUpdate?: (props, prevProps) => void;
  willUnmount?: (props) => void;
  didCatch?: (error, info, props) => void;
  [key: string]: any;
}