1.0.3 • Published 5 years ago

react-hooklib v1.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

react-hooklib

Helpers working around React Hooks API.

This lib want keep as helpers, but not targeting a fullly Custom Hooks, it's targeting dev experience when building component based on React Hooks.

Build Status NPM Version

Install

You can install from NPM, or use files in lib.

npm install --save react-hooklib

Usage

This lib require React 16.8.0 or later, since it's based on React Hooks API.

Each helper can be imported individually:

import {onDidMount, onWillUnmount} from 'react-hooklib';
function Hello(){
  onDidMount(()=>{
    console.log('component did mount!');
  });
  onWillUnmount(()=>{
    console.log('component will unmount!');
  });
  return <div>Hello</div>
}

API

See API Document

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago