Performant, flexible and extensible forms with easy to use validation.
This React Component will help you to debug forms when working React Hook Form, and give you more insight about your form's detail.
$ npm install react-hook-form-devtools -D
import React from 'react';
import { useForm } from 'react-hook-form';
import { DevTool } from 'react-hook-form-devtools';
import './App.css';
const App = () => {
const { register, control, handleSubmit } = useForm({
mode: 'onChange',
});
return (
<>
<DevTool control={control} />
<form onSubmit={handleSubmit(d => console.log(d))}>
<h1>React Hook Form DevTools</h1>
<label>Test</label>
<input name="test" ref={register} />
<input type="submit" />
</form>
</>
);
};
export default App;
