Commit 15e6035
authored
Fix UI warning about NaNs (#4142)
`e.target.valueAsNumber` converts empty strings to NaNs, but passing
them to value attribute doesn't convert them back to empty strings.
```
## Error Type
Console Error
## Error Message
Received NaN for the `value` attribute. If this is expected, cast the value to a string.
at input (<anonymous>:null:null)
at TextField (lib/TextField/TextField.tsx:25:5)
at EditMirror (app/mirrors/[mirrorId]/edit/page.tsx:207:13)
## Code Frame
23 | }
24 | return (
> 25 | <BaseInputField
| ^
26 | {...(inputProps as ComponentProps<typeof BaseInputField>)}
27 | />
28 | );
Next.js version: 16.1.6 (Webpack)
```1 parent 4113fa6 commit 15e6035
1 file changed
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
237 | 241 | | |
238 | 242 | | |
239 | 243 | | |
| |||
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
256 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
257 | 265 | | |
258 | 266 | | |
259 | 267 | | |
| |||
273 | 281 | | |
274 | 282 | | |
275 | 283 | | |
276 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
277 | 289 | | |
278 | 290 | | |
279 | 291 | | |
| |||
0 commit comments