Skip to content

Instantly share code, notes, and snippets.

@sankalpk
Last active August 28, 2020 23:16
Show Gist options
  • Save sankalpk/ebac698e2f46e672276c140d14c954e9 to your computer and use it in GitHub Desktop.
Save sankalpk/ebac698e2f46e672276c140d14c954e9 to your computer and use it in GitHub Desktop.
Add react-hook-form debug component
// Import component and react-hook-form
import { DevTool } from "@hookform/devtools";
import { useForm } from "react-hook-form";
// Grab the control object form from the useForm hook
const { control, register, handleSubmit, errors } = useForm()
// Add component to wherever on the page
<DevTool control={control} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment