diff --git a/src/components/codeExamples/setValue.ts b/src/components/codeExamples/setValue.ts deleted file mode 100644 index e64065e5e..000000000 --- a/src/components/codeExamples/setValue.ts +++ /dev/null @@ -1,26 +0,0 @@ -export default `import { useForm } from "react-hook-form"; - -const App = () => { - const { register, setValue } = useForm(); - - return ( -
- - - -
- ); -}; -` diff --git a/src/components/codeExamples/setValueTs.tsx b/src/components/codeExamples/setValueTs.tsx deleted file mode 100644 index af7b6753c..000000000 --- a/src/components/codeExamples/setValueTs.tsx +++ /dev/null @@ -1,27 +0,0 @@ -export default `import { useForm } from "react-hook-form"; - -const App = () => { - const { register, setValue } = useForm({ - firstName: '' - }); - - return ( -
- - - -
- ); -}; -` diff --git a/src/components/codeExamples/setValueTypes.ts b/src/components/codeExamples/setValueTypes.ts deleted file mode 100644 index 02a04b64e..000000000 --- a/src/components/codeExamples/setValueTypes.ts +++ /dev/null @@ -1,27 +0,0 @@ -export default `import React from "react"; -import { useForm } from "react-hook-form"; - -type FormValues = { - string: string; - number: number; - object: { - number: number; - boolean: boolean; - }; - array: { - string: string; - boolean: boolean; - }[]; -}; - -export default function App() { - const { setValue } = useForm(); - - setValue("string", "test"); - // function setValue<"string", string>(name: "string", value: string, shouldValidate?: boolean | undefined): void - setValue("number", 1); - // function setValue<"number", number>(name: "number", value: number, shouldValidate?: boolean | undefined): void - setValue("number", "error"); - - return
; -}` diff --git a/src/components/useForm/SetValue.tsx b/src/components/useForm/SetValue.tsx deleted file mode 100644 index 6902a5109..000000000 --- a/src/components/useForm/SetValue.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import Footer from "../Footer" -import api from "../../data/api" -import typographyStyles from "../../styles/typography.module.css" -import containerStyles from "../../styles/container.module.css" -import TabGroup from "../TabGroup" -import CodeArea from "../CodeArea" -import setValue from "../codeExamples/setValue" -import setValueTs from "../codeExamples/setValueTs" -import setValueTypes from "../codeExamples/setValueTypes" -import dependantFields from "../codeExamples/dependantFieldsTS" -import StarRepo from "../StarRepo" -import { Menu, apiLinks } from "../Menu" - -const SetValue = () => { - return ( -
-

- setValue -

-

Update field value

- -
- - -
-
- -

- setValue:{" "} - - (name: string, value: unknown, config?: Object) => void - -

-
- - {api.setValue.description} - -

- Examples -

- - - - - - -

Video

- -

- The following video tutorial demonstrates setValue{" "} - API in detail. -

- -