Skip to content

Commit 1136a2c

Browse files
fix: simplify demo
1 parent dcc1048 commit 1136a2c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

example/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function App() {
4949
const [locale, setLocale] = React.useState<Language>(Language.EN);
5050
const [hideRequiredField, setHideRequiredField] = React.useState(false);
5151
const scrollViewRef = useRef<ScrollView>(null);
52-
const [{ submit, formProps, hasError }, fh] = useFormState<FormType>(
52+
const [{ submit, formProps }, fh] = useFormState<FormType>(
5353
{
5454
email: '',
5555
telephone: '',
@@ -107,8 +107,8 @@ export default function App() {
107107
<Form {...formProps}>
108108
<TextInputWithError
109109
mode="outlined"
110-
error={hasError('email')}
111110
{...fh.email('email', {
111+
required: true,
112112
validate: (v) => {
113113
return looksLikeMail(v) ? true : 'Email-address is invalid';
114114
},

example/src/TextInputWithError.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ function TextInputWithError(
1414
},
1515
ref: any
1616
) {
17-
console.log('render', rest.label);
1817
return (
1918
<>
2019
{/*// @ts-ignore*/}

0 commit comments

Comments
 (0)