File tree Expand file tree Collapse file tree 17 files changed +36
-38
lines changed
_official-blog-tutorial/app/routes
_official-tutorial/app/routes
client-side-validation/app
combobox-resource-route/app/routes
io-ts-formdata-decoding/app/routes
remix-auth-supabase-github/app/routes
remix-auth-supabase/app/routes
tiptap-collab-editing/app/routes Expand file tree Collapse file tree 17 files changed +36
-38
lines changed Original file line number Diff line number Diff line change @@ -23,5 +23,7 @@ module.exports = {
23
23
"newlines-between" : "always" ,
24
24
} ,
25
25
] ,
26
+
27
+ "react/jsx-no-leaked-render" : [ WARN , { validStrategies : [ "ternary" ] } ] ,
26
28
} ,
27
29
} ;
Original file line number Diff line number Diff line change @@ -108,11 +108,11 @@ export default function Join() {
108
108
aria-describedby = "email-error"
109
109
className = "w-full rounded border border-gray-500 px-2 py-1 text-lg"
110
110
/>
111
- { actionData ?. errors ?. email && (
111
+ { actionData ?. errors ?. email ? (
112
112
< div className = "pt-1 text-red-700" id = "email-error" >
113
113
{ actionData . errors . email }
114
114
</ div >
115
- ) }
115
+ ) : null }
116
116
</ div >
117
117
</ div >
118
118
@@ -134,11 +134,11 @@ export default function Join() {
134
134
aria-describedby = "password-error"
135
135
className = "w-full rounded border border-gray-500 px-2 py-1 text-lg"
136
136
/>
137
- { actionData ?. errors ?. password && (
137
+ { actionData ?. errors ?. password ? (
138
138
< div className = "pt-1 text-red-700" id = "password-error" >
139
139
{ actionData . errors . password }
140
140
</ div >
141
- ) }
141
+ ) : null }
142
142
</ div >
143
143
</ div >
144
144
Original file line number Diff line number Diff line change @@ -101,11 +101,11 @@ export default function LoginPage() {
101
101
aria-describedby = "email-error"
102
102
className = "w-full rounded border border-gray-500 px-2 py-1 text-lg"
103
103
/>
104
- { actionData ?. errors ?. email && (
104
+ { actionData ?. errors ?. email ? (
105
105
< div className = "pt-1 text-red-700" id = "email-error" >
106
106
{ actionData . errors . email }
107
107
</ div >
108
- ) }
108
+ ) : null }
109
109
</ div >
110
110
</ div >
111
111
@@ -127,11 +127,11 @@ export default function LoginPage() {
127
127
aria-describedby = "password-error"
128
128
className = "w-full rounded border border-gray-500 px-2 py-1 text-lg"
129
129
/>
130
- { actionData ?. errors ?. password && (
130
+ { actionData ?. errors ?. password ? (
131
131
< div className = "pt-1 text-red-700" id = "password-error" >
132
132
{ actionData . errors . password }
133
133
</ div >
134
- ) }
134
+ ) : null }
135
135
</ div >
136
136
</ div >
137
137
Original file line number Diff line number Diff line change @@ -69,11 +69,11 @@ export default function NewNotePage() {
69
69
}
70
70
/>
71
71
</ label >
72
- { actionData ?. errors ?. title && (
72
+ { actionData ?. errors ?. title ? (
73
73
< Alert className = "pt-1 text-red-700" id = "title-error" >
74
74
{ actionData . errors . title }
75
75
</ Alert >
76
- ) }
76
+ ) : null }
77
77
</ div >
78
78
79
79
< div >
@@ -90,11 +90,11 @@ export default function NewNotePage() {
90
90
}
91
91
/>
92
92
</ label >
93
- { actionData ?. errors ?. body && (
93
+ { actionData ?. errors ?. body ? (
94
94
< Alert className = "pt-1 text-red-700" id = "body-error" >
95
95
{ actionData . errors . body }
96
96
</ Alert >
97
- ) }
97
+ ) : null }
98
98
</ div >
99
99
100
100
< div className = "text-right" >
Original file line number Diff line number Diff line change @@ -56,19 +56,17 @@ export default function Contact() {
56
56
< Favorite contact = { contact } />
57
57
</ h1 >
58
58
59
- { contact . twitter && (
60
- < p >
59
+ { contact . twitter ? < p >
61
60
< a
62
61
target = "_blank"
63
62
href = { `https://twitter.com/${ contact . twitter } ` }
64
63
rel = "noreferrer"
65
64
>
66
65
{ contact . twitter }
67
66
</ a >
68
- </ p >
69
- ) }
67
+ </ p > : null }
70
68
71
- { contact . notes && < p > { contact . notes } </ p > }
69
+ { contact . notes ? < p > { contact . notes } </ p > : null }
72
70
73
71
< div >
74
72
< Form action = "edit" >
Original file line number Diff line number Diff line change @@ -180,9 +180,9 @@ export default function App() {
180
180
< button > Submit</ button >
181
181
</ div >
182
182
</ form >
183
- { actionData ?. message && (
183
+ { actionData ?. message ? (
184
184
< div className = "result" > { actionData . message } </ div >
185
- ) }
185
+ ) : null }
186
186
</ div >
187
187
< ScrollRestoration />
188
188
< Scripts />
Original file line number Diff line number Diff line change @@ -41,11 +41,11 @@ export default function Index() {
41
41
/>
42
42
43
43
{ /* Add a nice spinner when the fetcher is loading */ }
44
- { langs . state === "loading" && < Spinner /> }
44
+ { langs . state === "loading" ? < Spinner /> : null }
45
45
</ div >
46
46
47
47
{ /* Only show the popover if we have results */ }
48
- { langs . data && langs . data . length > 0 && (
48
+ { langs . data && langs . data . length > 0 ? (
49
49
< ComboboxPopover >
50
50
< ComboboxList >
51
51
{ langs . data . map ( ( lang , index ) => (
@@ -55,13 +55,13 @@ export default function Index() {
55
55
) ) }
56
56
</ ComboboxList >
57
57
</ ComboboxPopover >
58
- ) }
58
+ ) : null }
59
59
</ Combobox >
60
60
< p >
61
61
< button type = "submit" > Submit</ button > { " " }
62
- { searchParams . has ( "lang" ) && (
62
+ { searchParams . has ( "lang" ) ? (
63
63
< span > You submitted: { searchParams . get ( "lang" ) } </ span >
64
- ) }
64
+ ) : null }
65
65
</ p >
66
66
</ Form >
67
67
) ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export default function Login() {
46
46
return (
47
47
< div >
48
48
< h1 > Join</ h1 >
49
- { actionData ?. error && < p > { actionData . error } </ p > }
49
+ { actionData ?. error ? < p > { actionData . error } </ p > : null }
50
50
< Form method = "post" >
51
51
< input
52
52
style = { { display : "block" } }
Original file line number Diff line number Diff line change @@ -93,9 +93,7 @@ export default function Login() {
93
93
return (
94
94
< div >
95
95
< h1 > Login</ h1 >
96
- { ( clientAction ?. error || actionData ?. error ) && (
97
- < p > { clientAction ?. error || actionData ?. error } </ p >
98
- ) }
96
+ { ( clientAction ?. error || actionData ?. error ) ? < p > { clientAction ?. error || actionData ?. error } </ p > : null }
99
97
< form method = "post" onSubmit = { handleSubmit } >
100
98
< input
101
99
style = { { display : "block" } }
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export default function App() {
45
45
</ head >
46
46
< body >
47
47
< Outlet />
48
- { ! track && (
48
+ { track ? null : (
49
49
< div
50
50
style = { {
51
51
backgroundColor : "#ccc" ,
You can’t perform that action at this time.
0 commit comments