@graphcommerce/react-hook-form 5.2.0-canary.1 → 5.2.0-canary.10

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 5.2.0-canary.10
4
+
5
+ ## 5.2.0-canary.9
6
+
7
+ ## 5.2.0-canary.8
8
+
9
+ ## 5.2.0-canary.7
10
+
11
+ ## 5.2.0-canary.6
12
+
13
+ ## 5.2.0-canary.5
14
+
15
+ ## 5.2.0-canary.4
16
+
17
+ ## 5.2.0-canary.3
18
+
19
+ ## 5.2.0-canary.2
20
+
3
21
  ## 5.2.0-canary.1
4
22
 
5
23
  ## 5.2.0-canary.0
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": "5.2.0-canary.1",
5
+ "version": "5.2.0-canary.10",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -14,12 +14,12 @@
14
14
  "dependencies": {
15
15
  "@apollo/client": "^3.7.2",
16
16
  "graphql": "16.6.0",
17
- "react-hook-form": "7.40.0"
17
+ "react-hook-form": "7.41.5"
18
18
  },
19
19
  "devDependencies": {
20
- "@graphcommerce/eslint-config-pwa": "5.2.0-canary.1",
21
- "@graphcommerce/prettier-config-pwa": "5.2.0-canary.1",
22
- "@graphcommerce/typescript-config-pwa": "5.2.0-canary.1",
20
+ "@graphcommerce/eslint-config-pwa": "5.2.0-canary.10",
21
+ "@graphcommerce/prettier-config-pwa": "5.2.0-canary.10",
22
+ "@graphcommerce/typescript-config-pwa": "5.2.0-canary.10",
23
23
  "@testing-library/react": "^13.4.0"
24
24
  },
25
25
  "peerDependencies": {
@@ -6,7 +6,7 @@ import {
6
6
  LazyQueryResultTuple,
7
7
  } from '@apollo/client'
8
8
  import { useEffect, useRef } from 'react'
9
- import { FieldValues, UseFormProps, UseFormReturn } from 'react-hook-form'
9
+ import { DefaultValues, FieldValues, UseFormProps, UseFormReturn } from 'react-hook-form'
10
10
  import diff from './diff'
11
11
  import { useGqlDocumentHandler, UseGqlDocumentHandler } from './useGqlDocumentHandler'
12
12
 
@@ -58,7 +58,8 @@ export function useFormGql<Q, V extends FieldValues>(
58
58
  initital.current = false
59
59
  return
60
60
  }
61
- form.reset(defaultValues, { keepDirtyValues: true })
61
+ if (defaultValues instanceof Promise) return
62
+ form.reset(defaultValues as DefaultValues<V>, { keepDirtyValues: true })
62
63
  // eslint-disable-next-line react-hooks/exhaustive-deps
63
64
  }, [valuesString, form])
64
65