Skip to content

Instantly share code, notes, and snippets.

@pochka15
Created January 30, 2023 09:13
Show Gist options
  • Select an option

  • Save pochka15/187803aeaed2e1a1a81cae7c84364460 to your computer and use it in GitHub Desktop.

Select an option

Save pochka15/187803aeaed2e1a1a81cae7c84364460 to your computer and use it in GitHub Desktop.
import React from 'react';
import {useForm} from 'react-hook-form';
import RegisteredInput from './registered-input';
type FormValues = {
name: string;
age: number;
};
function getFormValues(): FormValues {
return {name: 'Artem', age: 10};
}
function Playground() {
const form = useForm({defaultValues: getFormValues()});
return <RegisteredInput name="test" control={form.control} />;
}
export default Playground;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment