@graphcommerce/react-hook-form 8.1.0-canary.37 → 8.1.0-canary.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/package.json +4 -4
- package/src/useFormPersist.tsx +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 8.1.0-canary.39
|
|
4
|
+
|
|
5
|
+
## 8.1.0-canary.38
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#2305](https://github.com/graphcommerce-org/graphcommerce/pull/2305) [`77e8297`](https://github.com/graphcommerce-org/graphcommerce/commit/77e82976816994336c616208a651cb18ce9ea270) - Fix bug with persist not applying saved changes by moving <FromPersist/> below the form components
|
|
10
|
+
([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
11
|
+
|
|
3
12
|
## 8.1.0-canary.37
|
|
4
13
|
|
|
5
14
|
## 8.1.0-canary.36
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/react-hook-form",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "8.1.0-canary.
|
|
5
|
+
"version": "8.1.0-canary.39",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@apollo/client": "^3",
|
|
19
|
-
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.
|
|
20
|
-
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.
|
|
21
|
-
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.
|
|
19
|
+
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.39",
|
|
20
|
+
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.39",
|
|
21
|
+
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.39",
|
|
22
22
|
"graphql": "^16.6.0",
|
|
23
23
|
"react": "^18.2.0",
|
|
24
24
|
"react-dom": "^18.2.0",
|
package/src/useFormPersist.tsx
CHANGED
|
@@ -39,7 +39,7 @@ export type UseFormPersistOptions<
|
|
|
39
39
|
*
|
|
40
40
|
* Todo: Use wath callback so it won't trigger a rerender
|
|
41
41
|
*
|
|
42
|
-
* @deprecated Please use
|
|
42
|
+
* @deprecated Please use the FormPersist component instead. This method causes INP problems.
|
|
43
43
|
*/
|
|
44
44
|
export function useFormPersist<V extends FieldValues>(options: UseFormPersistOptions<V>) {
|
|
45
45
|
const { form, name, storage = 'sessionStorage', exclude = [], persist = [] } = options
|
|
@@ -98,6 +98,9 @@ export function useFormPersist<V extends FieldValues>(options: UseFormPersistOpt
|
|
|
98
98
|
}, [name, storage, valuesJson])
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Please make sure to always include this component at the end of your form because of useWatch rules: https://react-hook-form.com/docs/usewatch
|
|
103
|
+
*/
|
|
101
104
|
export function FormPersist<V extends FieldValues>(props: UseFormPersistOptions<V>) {
|
|
102
105
|
useFormPersist(props)
|
|
103
106
|
return null
|