react-micro-lifecycles

1.0.0 • Public • Published

react-micro-lifecycles

Use micro-life-cycles:

<div
  $attach={(el, props) => console.log('element attached: ', el, props)}
  $update={(el, props, oldProps) => console.log('element updated: ', el, props, oldProps)}
  $detach={(el, oldProps) => console.log('element detached: ', el, oldProps)}
/>

Installation:

require('react-micro-lifecycles/lib/patchStable');

or

require('react-micro-lifecycles/lib/patchUnstable');

patchStable uses React stateful components, patchUnstable does not use React stateful components — it uses only ref prop.

Package Sidebar

Install

npm i react-micro-lifecycles

Weekly Downloads

5

Version

1.0.0

License

none

Unpacked Size

26.4 kB

Total Files

21

Last publish

Collaborators

  • streamich