Repository navigation
Commit d7fd741
fix(solid-form): generate an SSR-safe default formId (#2263)
* fix(solid-form): generate an SSR-safe default formId
`createForm` never passed a `formId` to `FormApi`, so it fell back to
`uuid()`, which is seeded from `Math.random()` and therefore differs
between the server render and the client render. Binding it
(`<form id={form.formId}>`) produced a hydration mismatch under
SolidStart.
Use Solid's `createUniqueId()` for the default instead, which is what
the other adapters already do:
- react-form/src/useFormId.ts — React.useId, falling back to useUUID on React 17
- preact-form/src/useFormId.ts — useId from preact/hooks
- vue-form/src/useFormId.ts — Vue's useId, added in #2259
An explicitly provided `formId` is still preserved.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs(solid-form): correct changeset wording for the formId fallback
An explicitly provided `formId` was already forwarded to `FormApi`; only
the fallback was missing. Say that, and capitalize the framework names.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 77d6815 commit d7fd741
3 files changed
Lines changed: 51 additions & 2 deletions
File tree
- .changeset
- packages/solid-form
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
243 | 251 | | |
244 | 252 | | |
245 | 253 | | |
| |||
253 | 261 | | |
254 | 262 | | |
255 | 263 | | |
256 | | - | |
| 264 | + | |
257 | 265 | | |
258 | 266 | | |
259 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments