react-with-hooks-odgn
v1.0.0
Published
Ponyfill for the [proposed React Hooks API](https://reactjs.org/docs/hooks-intro.html).
Readme
react-with-hooks
Ponyfill for the proposed React Hooks API.
Install
$ npm i odgn-react-with-hooks --saveExample
import withHooks, { useState, useEffect } from 'odgn-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>
);
});API Reference
- Basic Hooks
- Additional Hooks
