@@ -57,7 +57,7 @@ function BuilderPage({
5757 state : { formData = [ ] } ,
5858 actions : { updateFormData } ,
5959 } = useStateMachine ( {
60- updateFormData : ( state , payload ) => {
60+ updateFormData : ( state , payload : GlobalState [ "formData" ] ) => {
6161 return {
6262 ...state ,
6363 formData : [ ...payload ] ,
@@ -81,7 +81,7 @@ function BuilderPage({
8181 setEditFormData ( defaultValue )
8282 setEditIndex ( - 1 )
8383 } else {
84- updateFormData ( [ ...formData , ... [ data ] ] )
84+ updateFormData ( [ ...formData , data as FormDataItem ] )
8585 }
8686 reset ( )
8787 }
@@ -153,7 +153,7 @@ function BuilderPage({
153153 reset = { reset }
154154 />
155155 </ section >
156-
156+ { /* eslint-disable-next-line @typescript-eslint/no-misused-promises */ }
157157 < form className = { styles . form } onSubmit = { handleSubmit ( onSubmit ) } >
158158 < h2 className = { typographyStyles . title } ref = { form } >
159159 { builder . inputCreator . title }
@@ -255,7 +255,9 @@ function BuilderPage({
255255 < input
256256 type = "checkbox"
257257 { ...register ( "toggle" , { required : false } ) }
258- onClick = { ( ) => toggleValidation ( ! showValidation ) }
258+ onClick = { ( ) => {
259+ toggleValidation ( ! showValidation )
260+ } }
259261 />
260262 { builder . inputCreator . validation }
261263 </ label >
@@ -325,7 +327,7 @@ function BuilderPage({
325327 < button
326328 className = { buttonStyles . pinkButton }
327329 onClick = { ( ) => {
328- form ? .current ?. scrollIntoView ( { behavior : "smooth" } )
330+ form . current ?. scrollIntoView ( { behavior : "smooth" } )
329331 } }
330332 >
331333 { editIndex >= 0 ? generic . update : generic . create }
@@ -345,7 +347,7 @@ function BuilderPage({
345347 ) }
346348
347349 < Animate
348- play = { ( formData || [ ] ) . length > 0 }
350+ play = { formData . length > 0 }
349351 start = { {
350352 opacity : 0 ,
351353 pointerEvents : "none" ,
@@ -374,7 +376,6 @@ function BuilderPage({
374376 ) }
375377 />
376378 </ form >
377-
378379 < section
379380 style = { {
380381 paddingRight : "20px" ,
@@ -395,7 +396,9 @@ function BuilderPage({
395396 >
396397 < div className = { styles . buttonWrapper } >
397398 < ClipBoard
398- onClick = { ( ) => copyClipBoard ( generateCode ( formData ) ) }
399+ onClick = { ( ) => {
400+ copyClipBoard ( generateCode ( formData ) )
401+ } }
399402 className = { `${ styles . button } ${ styles . copyButton } ` }
400403 />
401404 </ div >
0 commit comments