Commit 6a5e1c1
fix(react-form): fix server hydration issues (#1913)
* fix(react-form): fix cache components support
Attempts to resolve #1907
Removes `Math.random()` introduced in #1893 from the hot path allowing the page to be pre-built with a a user provided form id.
source: https://nextjs.org/docs/app/getting-started/cache-components#non-deterministic-operations
* generate changeset
* Change to patch
* feat: use useId on React 18+ with a fallback to uuid on React 17
* chore: incredible review feedback
* update changelog
* chore: rename file
* import correctly
* return a stable UUID reference
* chore: switch from useMemo to useState
* ci: apply automated fixes and generate docs
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent 883867d commit 6a5e1c1
File tree
4 files changed
+22
-2
lines changed- .changeset
- packages/react-form/src
4 files changed
+22
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
187 | | - | |
| 188 | + | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments