Created
January 30, 2023 09:13
-
-
Save pochka15/187803aeaed2e1a1a81cae7c84364460 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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