@alobato/use-scroll-to-error

React hook scroll to error using formik

Usage no npm install needed!

<script type="module">
  import alobatoUseScrollToError from 'https://cdn.skypack.dev/@alobato/use-scroll-to-error';
</script>

README

useScrollToError

React hook use-scroll-to-error

Note: This is using the new React Hooks API

You'll need to install react, react-dom, etc at ^16.8.0 or above

Install

yarn add @alobato/use-scroll-to-error

Usage

import useKeyPress from '@alobato/use-scroll-to-error'
...
  useFocusOnLoad('name')
  useScrollToError({errors, isValid, isSubmitting})