diff --git a/README.md b/README.md index 718ffec9..0358f316 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ - [`useObservable`](./docs/useObservable.md) — tracks latest value of an `Observable`. - [`useSetState`](./docs/useSetState.md) — creates `setState` method which works like `this.setState`. [![][img-demo]](https://codesandbox.io/s/n75zqn1xp0) - [`useToggle` and `useBoolean`](./docs/useToggle.md) — tracks state of a boolean. - - [`useCounter` as `useNumber`](./docs/useCounter.md) — tracks state of a number. + - [`useCounter` and `useNumber`](./docs/useCounter.md) — tracks state of a number. - [`useList`](./docs/useList.md) — tracks state of an array. - [`useMap`](./docs/useMap.md) — tracks state of an object.
diff --git a/docs/useCounter.md b/docs/useCounter.md index 524a2eb6..a64102a8 100644 --- a/docs/useCounter.md +++ b/docs/useCounter.md @@ -8,16 +8,21 @@ React state hook that tracks a numeric value. ## Usage ```jsx -import {useCounter} from 'react-use'; +import {useCounter, useNumber} from 'react-use'; const Demo = () => { - const [value, inc, set] = useCounter(); + const [value, {inc, dec, get, set, reset}] = useCounter(5); return (
-
{value}
+
{value} is {get()}
+ + + + +
); };