@@ -42,7 +42,7 @@ function MyComponent() {
42
42
description : ' Cool product' ,
43
43
}}
44
44
>
45
- {formDetails = > {
45
+ {( formDetails ) = > {
46
46
const {fields } = formDetails;
47
47
const {title , description } = fields;
48
48
@@ -92,7 +92,7 @@ function MyComponent() {
92
92
description : ' Cool product' ,
93
93
}}
94
94
>
95
- {formDetails = > {
95
+ {( formDetails ) = > {
96
96
const {fields } = formDetails;
97
97
98
98
return (
@@ -132,7 +132,7 @@ const fakeErrorResult = {error: [{message: 'api is not real'}]};
132
132
133
133
// simple async function that fakes a failing api call
134
134
export function fakeApiCall(data : any ) {
135
- return new Promise (resolve => {
135
+ return new Promise (( resolve ) => {
136
136
setTimeout (() => {
137
137
resolve (fakeErrorResult );
138
138
}, 2000 );
@@ -165,7 +165,7 @@ export function MyPage() {
165
165
{!valid && (
166
166
<Banner status = " critical" >
167
167
<ul >
168
- {errors .map (error = > (
168
+ {errors .map (( error ) = > (
169
169
< li key = {` ${error .message }${error .field } ` }>
170
170
{error .message }
171
171
< / li >
@@ -274,7 +274,7 @@ export function MyPage() {
274
274
export type ValidatorDictionary <Fields > = {
275
275
[FieldPath in keyof Fields ]: MaybeArray <
276
276
ValidationFunction <Fields [FieldPath ], Fields >
277
- >
277
+ >;
278
278
};
279
279
280
280
interface ValidationFunction <Value , Fields > {
@@ -359,7 +359,7 @@ function MyComponent() {
359
359
},
360
360
}}
361
361
>
362
- {formDetails = > {
362
+ {( formDetails ) = > {
363
363
const {fields } = formDetails;
364
364
365
365
return (
@@ -401,7 +401,7 @@ function MyComponent() {
401
401
console .log (' I will not be run if title is too long' );
402
402
}}
403
403
>
404
- {formDetails = > {
404
+ {( formDetails ) = > {
405
405
const {errors , fields , submit } = formDetails;
406
406
407
407
const errorBanner = Boolean (errors .length ) && (
@@ -706,7 +706,7 @@ function CreateProductPage({initialValues}: Props) {
706
706
return [{message: ' server error' }];
707
707
}}
708
708
>
709
- {formDetails = > {
709
+ {( formDetails ) = > {
710
710
const {fields , dirty , reset , submit , submitting , errors } = formDetails;
711
711
const {
712
712
title ,
@@ -733,7 +733,7 @@ function CreateProductPage({initialValues}: Props) {
733
733
const errorBanner = errors .length > 0 && (
734
734
< Banner status = " critical" >
735
735
<ul >
736
- {errors.map(error => (
736
+ {errors.map(( error) => (
737
737
<li key = {` ${error .message }${error .field } ` }> {error.message }< / li >
738
738
))}
739
739
< / ul >
0 commit comments