-
- errors:{" "}
- {`Record`}
-
-
-
- {api.errors.description}
-
- | {generic.name} | -- {generic.type} - | -{generic.description} | -
|---|---|---|
- type
- |
- - string - | -Error {generic.type}. eg: required, min, max, minLength | -
- types
- |
- - {`Record<{ string, string | boolean }>`} - | -{api.errors.types} | -
- message
- |
- - - string | React.ReactElement - - | -{api.errors.message} | -
- ref
- |
- - React.Ref - | -{api.errors.ref} | -
- > - ) -} - -export default memo(ApiErrors) diff --git a/src/components/ApiGallery.module.css b/src/components/ApiGallery.module.css index d7f929e00..85140aa7d 100644 --- a/src/components/ApiGallery.module.css +++ b/src/components/ApiGallery.module.css @@ -37,12 +37,9 @@ border: 1px solid var(--color-light-blue); position: relative; padding-bottom: 30px; - transition: 0.2s all; } .gallery li:hover { - transform: translate(-2px, -2px); - box-shadow: 2px 2px 0 4px black; border: 1px solid var(--color-secondary); } diff --git a/src/components/ApiWatch.tsx b/src/components/ApiWatch.tsx deleted file mode 100644 index fde39656d..000000000 --- a/src/components/ApiWatch.tsx +++ /dev/null @@ -1,212 +0,0 @@ -import CodeArea from "./CodeArea" -import watchCode from "./codeExamples/watchCode" -import watchCodeTs from "./codeExamples/watchCodeTs" -import generic from "../data/generic" -import typographyStyles from "../styles/typography.module.css" -import tableStyles from "../styles/table.module.css" -import TabGroup from "./TabGroup" -import watchFieldArrayCode from "./codeExamples/watchFieldArrayCode" -import StarRepo from "./StarRepo" -import Link from "next/link" - -export default function ApiWatch({ api }: { api: any }) { - return ( - <> -
-
- watch:{" "}
- {`(names?: string | string[] | (data, options) => void) => unknown`}
-
-
-
- {api.watch.description}
-
- Props
- -| - {generic.type} - | -- {generic.description} - | -
|---|---|
- string
- |
- {api.watch.tableTitle.single} | -
- string[]
- |
- {api.watch.tableTitle.multiple} | -
- undefined
- |
- {api.watch.tableTitle.all} | -
- {`(data: unknown, { name: string, type: string }) => void`}
- |
- {api.watch.tableTitle.callback} | -
Return
- -| - {generic.example} - | -- {generic.return} - | -
|---|---|
- watch('inputName')
- |
-
- unknown
- |
-
- watch(['inputName1'])
- |
-
- unknown[]
- |
-
- watch()
- |
-
- {`{[key:string]: unknown}`}
- |
-
- {`watch((data, { name, type }) => console.log(data, name, type))`}
- |
-
- {`{ unsubscribe: () => void }`}
- |
-
- Rules -
- --
-
-
-
- When
-defaultValueis not defined, the first render of{" "} -watchwill returnundefinedbecause it is - called beforeregister. It's recommend to - providedefaultValuesatuseFormto avoid - this behaviour, but you can set the inlinedefaultValue{" "} - as the second argument. -
- -
-
- When both
-defaultValueanddefaultValues{" "} - are supplied,defaultValuewill be returned. -
- -
-
- This API will trigger re-render at the root of your app or form, - consider using a callback or the{" "} - useWatch api if you are - experiencing performance issues. -
-
- -
-
-
-watchresult is optimised for render phase instead of{" "} -useEffect's deps, to detect value update you may want - to use an external custom hook for value comparison. -
-
- Examples -
- -Video
- -
- The following video tutorial demonstrates watch API.
-
- ★ Strictly typed form -
, -- ★ Smaller Package Size (-13%) -
, -- ★ More performant than ever -
, -- ★ New Resolver & DevTools -
, -★ API Refinements
, -- ★ New custom hook useFormState -
, -] - -export default function CardPlay({ isCardPlay }: { isCardPlay: boolean }) { - return ( -- V7 is Live! -
- -Thanks to the team members:
-- - 🏅 - - Achievements -
--
- {list.map((item, index) => (
-
- {item} } - /> - ))} -