0.0.2 • Published 6 years ago

rehook v0.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

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);