1.1.6 • Published 5 years ago
react-with-hooks v1.1.6
react-with-hooks
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>
);
});
API Reference
- Basic Hooks
- Additional Hooks
- useReducer
- useCallback
- useMemo
- useRef
- useImperativeMethod
- ⚠️ useMutationEffect - works same as
useEffect
- ⚠️ useLayoutEffect - works same as
useEffect
License
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