1
- import { ActionArgs , json } from "@remix-run/node" ;
1
+ import type { ActionArgs } from "@remix-run/node" ;
2
+ import { json } from "@remix-run/node" ;
2
3
import { Form , Link , useActionData , useNavigation } from "@remix-run/react" ;
3
4
import * as z from "zod" ;
4
5
@@ -108,13 +109,11 @@ export default function RegisterView() {
108
109
name = "firstName"
109
110
defaultValue = { actionData ?. fields ?. firstName }
110
111
/>
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
+ ) ) }
118
117
</ div >
119
118
120
119
< br />
@@ -127,13 +126,11 @@ export default function RegisterView() {
127
126
name = "email"
128
127
defaultValue = { actionData ?. fields ?. email }
129
128
/>
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
+ ) ) }
137
134
</ div >
138
135
139
136
< br />
@@ -146,13 +143,11 @@ export default function RegisterView() {
146
143
name = "birthday"
147
144
defaultValue = { actionData ?. fields ?. birthday }
148
145
/>
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
+ ) ) }
156
151
</ div >
157
152
158
153
< br />
0 commit comments