1- import { ActionArgs , json } from "@remix-run/node" ;
1+ import type { ActionArgs } from "@remix-run/node" ;
2+ import { json } from "@remix-run/node" ;
23import { Form , Link , useActionData , useNavigation } from "@remix-run/react" ;
34import * as z from "zod" ;
45
@@ -108,13 +109,11 @@ export default function RegisterView() {
108109 name = "firstName"
109110 defaultValue = { actionData ?. fields ?. firstName }
110111 />
111- { actionData ?. fieldErrors ?. firstName
112- ? actionData . fieldErrors . firstName . map ( ( error , index ) => (
113- < p style = { errorTextStyle } key = { `first-name-error-${ index } ` } >
114- { error }
115- </ p >
116- ) )
117- : null }
112+ { actionData ?. fieldErrors ?. firstName ?. map ( ( error , index ) => (
113+ < p style = { errorTextStyle } key = { `first-name-error-${ index } ` } >
114+ { error }
115+ </ p >
116+ ) ) }
118117 </ div >
119118
120119 < br />
@@ -127,13 +126,11 @@ export default function RegisterView() {
127126 name = "email"
128127 defaultValue = { actionData ?. fields ?. email }
129128 />
130- { actionData ?. fieldErrors ?. email
131- ? actionData . fieldErrors . email . map ( ( error , index ) => (
132- < p style = { errorTextStyle } key = { `email-error-${ index } ` } >
133- { error }
134- </ p >
135- ) )
136- : null }
129+ { actionData ?. fieldErrors ?. email ?. map ( ( error , index ) => (
130+ < p style = { errorTextStyle } key = { `email-error-${ index } ` } >
131+ { error }
132+ </ p >
133+ ) ) }
137134 </ div >
138135
139136 < br />
@@ -146,13 +143,11 @@ export default function RegisterView() {
146143 name = "birthday"
147144 defaultValue = { actionData ?. fields ?. birthday }
148145 />
149- { actionData ?. fieldErrors ?. birthday
150- ? actionData . fieldErrors . birthday . map ( ( error , index ) => (
151- < p style = { errorTextStyle } key = { `birthday-error-${ index } ` } >
152- { error }
153- </ p >
154- ) )
155- : null }
146+ { actionData ?. fieldErrors ?. birthday ?. map ( ( error , index ) => (
147+ < p style = { errorTextStyle } key = { `birthday-error-${ index } ` } >
148+ { error }
149+ </ p >
150+ ) ) }
156151 </ div >
157152
158153 < br />
0 commit comments