react-hooklib
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i react-hooklib

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

35.7 kB

Total Files

7

Last publish

Collaborators

  • cssobj