@@ -57,7 +57,7 @@ function BuilderPage({
57
57
state : { formData = [ ] } ,
58
58
actions : { updateFormData } ,
59
59
} = useStateMachine ( {
60
- updateFormData : ( state , payload ) => {
60
+ updateFormData : ( state , payload : GlobalState [ "formData" ] ) => {
61
61
return {
62
62
...state ,
63
63
formData : [ ...payload ] ,
@@ -81,7 +81,7 @@ function BuilderPage({
81
81
setEditFormData ( defaultValue )
82
82
setEditIndex ( - 1 )
83
83
} else {
84
- updateFormData ( [ ...formData , ... [ data ] ] )
84
+ updateFormData ( [ ...formData , data as FormDataItem ] )
85
85
}
86
86
reset ( )
87
87
}
@@ -153,7 +153,7 @@ function BuilderPage({
153
153
reset = { reset }
154
154
/>
155
155
</ section >
156
-
156
+ { /* eslint-disable-next-line @typescript-eslint/no-misused-promises */ }
157
157
< form className = { styles . form } onSubmit = { handleSubmit ( onSubmit ) } >
158
158
< h2 className = { typographyStyles . title } ref = { form } >
159
159
{ builder . inputCreator . title }
@@ -255,7 +255,9 @@ function BuilderPage({
255
255
< input
256
256
type = "checkbox"
257
257
{ ...register ( "toggle" , { required : false } ) }
258
- onClick = { ( ) => toggleValidation ( ! showValidation ) }
258
+ onClick = { ( ) => {
259
+ toggleValidation ( ! showValidation )
260
+ } }
259
261
/>
260
262
{ builder . inputCreator . validation }
261
263
</ label >
@@ -325,7 +327,7 @@ function BuilderPage({
325
327
< button
326
328
className = { buttonStyles . pinkButton }
327
329
onClick = { ( ) => {
328
- form ? .current ?. scrollIntoView ( { behavior : "smooth" } )
330
+ form . current ?. scrollIntoView ( { behavior : "smooth" } )
329
331
} }
330
332
>
331
333
{ editIndex >= 0 ? generic . update : generic . create }
@@ -345,7 +347,7 @@ function BuilderPage({
345
347
) }
346
348
347
349
< Animate
348
- play = { ( formData || [ ] ) . length > 0 }
350
+ play = { formData . length > 0 }
349
351
start = { {
350
352
opacity : 0 ,
351
353
pointerEvents : "none" ,
@@ -374,7 +376,6 @@ function BuilderPage({
374
376
) }
375
377
/>
376
378
</ form >
377
-
378
379
< section
379
380
style = { {
380
381
paddingRight : "20px" ,
@@ -395,7 +396,9 @@ function BuilderPage({
395
396
>
396
397
< div className = { styles . buttonWrapper } >
397
398
< ClipBoard
398
- onClick = { ( ) => copyClipBoard ( generateCode ( formData ) ) }
399
+ onClick = { ( ) => {
400
+ copyClipBoard ( generateCode ( formData ) )
401
+ } }
399
402
className = { `${ styles . button } ${ styles . copyButton } ` }
400
403
/>
401
404
</ div >
0 commit comments