diff --git a/docs/framework/react/quick-start.md b/docs/framework/react/quick-start.md index 845bff06e..b75106113 100644 --- a/docs/framework/react/quick-start.md +++ b/docs/framework/react/quick-start.md @@ -32,7 +32,12 @@ export default function App() { ( - + field.handleChange(e.target.value)} + /> )} /> diff --git a/docs/guides/basic-concepts.md b/docs/guides/basic-concepts.md index 95275e62a..ed891eab0 100644 --- a/docs/guides/basic-concepts.md +++ b/docs/guides/basic-concepts.md @@ -49,7 +49,11 @@ Example: name="firstName" children={(field) => ( <> - + field.handleChange(e.target.value)} + /> )} @@ -68,12 +72,16 @@ const { value, error, touched, isValidating } = field.state ## Field API -The Field API is an object passed to the render prop function when creating a field. It provides methods for working with the field's state, such as getInputProps, which returns an object with props needed to bind the field to a form input element. +The Field API is an object passed to the render prop function when creating a field. It provides methods for working with the field's state. Example: ```tsx - + field.handleChange(e.target.value)} +/> ``` ## Validation @@ -92,7 +100,11 @@ Example: }} children={(field) => ( <> - + field.handleChange(e.target.value)} + /> )} @@ -143,7 +155,12 @@ Example: return (
- + field.handleChange(e.target.value)} + /> diff --git a/docs/overview.md b/docs/overview.md index d8fb606b4..9886dd356 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -36,7 +36,7 @@ function FieldInfo({ field }: { field: FieldApi }) { <> {field.state.meta.touchedError ? ( {field.state.meta.touchedError} - ) : null}{' '} + ) : null} {field.state.meta.isValidating ? 'Validating...' : null} ) @@ -93,7 +93,12 @@ export default function App() { return ( <> - + field.handleChange(e.target.value)} + /> ) @@ -106,7 +111,12 @@ export default function App() { children={(field) => ( <> - + field.handleChange(e.target.value)} + /> )} diff --git a/examples/react/simple/src/index.tsx b/examples/react/simple/src/index.tsx index e4b6745fd..81ec38f56 100644 --- a/examples/react/simple/src/index.tsx +++ b/examples/react/simple/src/index.tsx @@ -8,7 +8,7 @@ function FieldInfo({ field }: { field: FieldApi }) { <> {field.state.meta.touchedError ? ( {field.state.meta.touchedError} - ) : null}{" "} + ) : null} {field.state.meta.isValidating ? "Validating..." : null} ); @@ -65,7 +65,12 @@ export default function App() { return ( <> - + field.handleChange(e.target.value)} + /> ); @@ -78,7 +83,12 @@ export default function App() { children={(field) => ( <> - + field.handleChange(e.target.value)} + /> )} diff --git a/examples/react/simple/tsconfig.json b/examples/react/simple/tsconfig.json index 7e5f2b270..bb9f88a93 100644 --- a/examples/react/simple/tsconfig.json +++ b/examples/react/simple/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../../tsconfig.json", "compilerOptions": { "jsx": "react", - "noEmit": true + "noEmit": true, + "lib": ["DOM", "DOM.Iterable", "ES2020"] }, "include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.js"] }