All Projects → streamich → react-micro-lifecycles

streamich / react-micro-lifecycles

Licence: other
Life-cycles for React DOM elements

Programming Languages

javascript
184084 projects - #8 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].