rehook

0.0.2 • Public • Published

rehook

React Hooks wrapper, keeps functions pure

Usage

import React, { useState } from 'react';
import rehook from './rehook';

const Counter = ({ count, setCount }) => {
  return (
    <>
      <div>count is {count}</div>
      <button onClick={() => setCount(count + 1)}>Count Up</button>
    </>
  );
};

export default rehook([{ hook: useState, name: 'count', init: 0 }])(Counter);

Readme

Keywords

Package Sidebar

Install

npm i rehook

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

5.97 kB

Total Files

5

Last publish

Collaborators

  • craftgear