1.1.6 • Published 5 years ago

react-with-hooks v1.1.6

Weekly downloads
4,185
License
MIT
Repository
github
Last release
5 years ago

react-with-hooks

Build Status codecov

Ponyfill for the proposed React Hooks API.

Works on RN!

Install

$ npm i react-with-hooks --save

Example

import withHooks, { useState, useEffect } from 'react-with-hooks';

const Counter = withHooks(() => {
  const [ count, setCount ] = useState(0);
  useEffect(() => {
    document.title = "count is " + count;
  })
  return (
    <div>
      {count}
      <button onClick={() => setCount(count + 1)}>+</button>
      <button onClick={() => setCount(count - 1)}>-</button>
    </div>
  );
});

Live Demo

API Reference

License

MIT

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.1-alpha.3

6 years ago

0.0.1-alpha.2

6 years ago

0.0.1-alpha.1

6 years ago

0.0.1-alpha.0

6 years ago