react-life-hooks
React hooks for better managing lifecycles for function component.
This lib want keep as helpers
, but not targeting a fully Custom Hooks.
Install
You can install from NPM, or use files in lib
.
npm install --save react-life-hooks
Usage
This lib require React 16.8.0 or later, since it's based on React Hooks API.
Each helper can be imported individually:
{ ; ; ; // state, setState is life time, same reference in each render const state setState = // below have no bugs any more const onClick = { } return <div> <span>statex</span> <button onClick=onClick></button> </div>};