react-hooked

Useful React custom hooks


License
MIT
Install
npm install react-hooked@0.1.1

Documentation

react-hooked

♻️ Useful custom hooks for react.

Available Hooks

usePrevious

Lets you reference the previous prop or state of a component:

function Counter() {
  const [count, setCount] = useState(0);
  const prevCount = usePrevious(count);

  return (
    <h1>
      Now: {count}, before: {prevCount}
    </h1>
  );
}

Contributing

We use commitizen and standard-version for automating our release and changelog process:

# add files to be commited
git add .
# commit using `commitizen`
yarn cz
# bump version and regenerate CHANGELOG based on commit messages
yarn release
# publish
git push --follow-tags origin master && npm publish