Skip to content

Commit 411a777

Browse files
authored
Close 143 (#145)
* Revert "Use @emtion/react as peer dependency. (#144)" This reverts commit b0b75c6. * close #143 type conflict * revert package * update changeset
1 parent b0b75c6 commit 411a777

File tree

6 files changed

+64
-69
lines changed

6 files changed

+64
-69
lines changed

.changeset/stale-peas-know.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hookform/devtools': patch
3+
---
4+
5+
- fix control type conflict

example/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"serve": "vite preview"
88
},
99
"dependencies": {
10-
"@emotion/react": "^11.9.3",
1110
"@hookform/devtools": "file:..",
1211
"@reach/router": "^1.3.4",
1312
"loglevel": "^1.7.1",

example/yarn.lock

Lines changed: 22 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -244,34 +244,16 @@
244244
source-map "^0.5.7"
245245
stylis "^4.0.3"
246246

247-
"@emotion/babel-plugin@^11.7.1":
248-
version "11.9.2"
249-
resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.9.2.tgz#723b6d394c89fb2ef782229d92ba95a740576e95"
250-
integrity sha512-Pr/7HGH6H6yKgnVFNEj2MVlreu3ADqftqjqwUvDy/OJzKFgxKeTQ+eeUf20FOTuHVkDON2iNa25rAXVYtWJCjw==
251-
dependencies:
252-
"@babel/helper-module-imports" "^7.12.13"
253-
"@babel/plugin-syntax-jsx" "^7.12.13"
254-
"@babel/runtime" "^7.13.10"
255-
"@emotion/hash" "^0.8.0"
256-
"@emotion/memoize" "^0.7.5"
257-
"@emotion/serialize" "^1.0.2"
258-
babel-plugin-macros "^2.6.1"
259-
convert-source-map "^1.5.0"
260-
escape-string-regexp "^4.0.0"
261-
find-root "^1.1.0"
262-
source-map "^0.5.7"
263-
stylis "4.0.13"
264-
265-
"@emotion/cache@^11.9.3":
266-
version "11.9.3"
267-
resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.9.3.tgz#96638449f6929fd18062cfe04d79b29b44c0d6cb"
268-
integrity sha512-0dgkI/JKlCXa+lEXviaMtGBL0ynpx4osh7rjOXE71q9bIF8G+XhJgvi+wDu0B0IdCVx37BffiwXlN9I3UuzFvg==
247+
"@emotion/cache@^11.1.3":
248+
version "11.1.3"
249+
resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.1.3.tgz#c7683a9484bcd38d5562f2b9947873cf66829afd"
250+
integrity sha512-n4OWinUPJVaP6fXxWZD9OUeQ0lY7DvtmtSuqtRWT0Ofo/sBLCVSgb4/Oa0Q5eFxcwablRKjUXqXtNZVyEwCAuA==
269251
dependencies:
270252
"@emotion/memoize" "^0.7.4"
271-
"@emotion/sheet" "^1.1.1"
253+
"@emotion/sheet" "^1.0.0"
272254
"@emotion/utils" "^1.0.0"
273255
"@emotion/weak-memoize" "^0.2.5"
274-
stylis "4.0.13"
256+
stylis "^4.0.3"
275257

276258
"@emotion/hash@^0.8.0":
277259
version "0.8.0"
@@ -290,20 +272,20 @@
290272
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.5.tgz#2c40f81449a4e554e9fc6396910ed4843ec2be50"
291273
integrity sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ==
292274

293-
"@emotion/react@^11.9.3":
294-
version "11.9.3"
295-
resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.9.3.tgz#f4f4f34444f6654a2e550f5dab4f2d360c101df9"
296-
integrity sha512-g9Q1GcTOlzOEjqwuLF/Zd9LC+4FljjPjDfxSM7KmEakm+hsHXk+bYZ2q+/hTJzr0OUNkujo72pXLQvXj6H+GJQ==
275+
"@emotion/react@^11.1.5":
276+
version "11.1.5"
277+
resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.1.5.tgz#15e78f9822894cdc296e6f4e0688bac8120dfe66"
278+
integrity sha512-xfnZ9NJEv9SU9K2sxXM06lzjK245xSeHRpUh67eARBm3PBHjjKIZlfWZ7UQvD0Obvw6ZKjlC79uHrlzFYpOB/Q==
297279
dependencies:
298-
"@babel/runtime" "^7.13.10"
299-
"@emotion/babel-plugin" "^11.7.1"
300-
"@emotion/cache" "^11.9.3"
301-
"@emotion/serialize" "^1.0.4"
302-
"@emotion/utils" "^1.1.0"
280+
"@babel/runtime" "^7.7.2"
281+
"@emotion/cache" "^11.1.3"
282+
"@emotion/serialize" "^1.0.0"
283+
"@emotion/sheet" "^1.0.1"
284+
"@emotion/utils" "^1.0.0"
303285
"@emotion/weak-memoize" "^0.2.5"
304286
hoist-non-react-statics "^3.3.1"
305287

306-
"@emotion/serialize@^1.0.2":
288+
"@emotion/serialize@^1.0.0", "@emotion/serialize@^1.0.2":
307289
version "1.0.2"
308290
resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.0.2.tgz#77cb21a0571c9f68eb66087754a65fa97bfcd965"
309291
integrity sha512-95MgNJ9+/ajxU7QIAruiOAdYNjxZX7G2mhgrtDWswA21VviYIRP1R5QilZ/bDY42xiKsaktP4egJb3QdYQZi1A==
@@ -314,21 +296,10 @@
314296
"@emotion/utils" "^1.0.0"
315297
csstype "^3.0.2"
316298

317-
"@emotion/serialize@^1.0.4":
318-
version "1.0.4"
319-
resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.0.4.tgz#ff31fd11bb07999611199c2229e152faadc21a3c"
320-
integrity sha512-1JHamSpH8PIfFwAMryO2bNka+y8+KA5yga5Ocf2d7ZEiJjb7xlLW7aknBGZqJLajuLOvJ+72vN+IBSwPlXD1Pg==
321-
dependencies:
322-
"@emotion/hash" "^0.8.0"
323-
"@emotion/memoize" "^0.7.4"
324-
"@emotion/unitless" "^0.7.5"
325-
"@emotion/utils" "^1.0.0"
326-
csstype "^3.0.2"
327-
328-
"@emotion/sheet@^1.1.1":
329-
version "1.1.1"
330-
resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.1.1.tgz#015756e2a9a3c7c5f11d8ec22966a8dbfbfac787"
331-
integrity sha512-J3YPccVRMiTZxYAY0IOq3kd+hUP8idY8Kz6B/Cyo+JuXq52Ek+zbPbSQUrVQp95aJ+lsAW7DPL1P2Z+U1jGkKA==
299+
"@emotion/sheet@^1.0.0", "@emotion/sheet@^1.0.1":
300+
version "1.0.1"
301+
resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.0.1.tgz#245f54abb02dfd82326e28689f34c27aa9b2a698"
302+
integrity sha512-GbIvVMe4U+Zc+929N1V7nW6YYJtidj31lidSmdYcWozwoBIObXBnaJkKNDjZrLm9Nc0BR+ZyHNaRZxqNZbof5g==
332303

333304
"@emotion/styled@^11.3.0":
334305
version "11.3.0"
@@ -351,19 +322,15 @@
351322
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.0.0.tgz#abe06a83160b10570816c913990245813a2fd6af"
352323
integrity sha512-mQC2b3XLDs6QCW+pDQDiyO/EdGZYOygE8s5N5rrzjSI4M3IejPE/JPndCBwRT9z982aqQNi6beWs1UeayrQxxA==
353324

354-
"@emotion/utils@^1.1.0":
355-
version "1.1.0"
356-
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.1.0.tgz#86b0b297f3f1a0f2bdb08eeac9a2f49afd40d0cf"
357-
integrity sha512-iRLa/Y4Rs5H/f2nimczYmS5kFJEbpiVvgN3XVfZ022IYhuNA1IRSHEizcof88LtCTXtl9S2Cxt32KgaXEu72JQ==
358-
359325
"@emotion/weak-memoize@^0.2.5":
360326
version "0.2.5"
361327
resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46"
362328
integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==
363329

364330
"@hookform/devtools@file:..":
365-
version "4.1.0"
331+
version "3.0.2"
366332
dependencies:
333+
"@emotion/react" "^11.1.5"
367334
"@emotion/styled" "^11.3.0"
368335
"@types/lodash" "^4.14.168"
369336
little-state-machine "^4.1.0"
@@ -849,11 +816,6 @@ source-map@^0.6.1:
849816
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
850817
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
851818

852-
853-
version "4.0.13"
854-
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.0.13.tgz#f5db332e376d13cc84ecfe5dace9a2a51d954c91"
855-
integrity sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag==
856-
857819
stylis@^4.0.3:
858820
version "4.0.10"
859821
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.0.10.tgz#446512d1097197ab3f02fb3c258358c3f7a14240"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
},
5959
"homepage": "https://react-hook-form.com",
6060
"dependencies": {
61+
"@emotion/react": "^11.1.5",
6162
"@emotion/styled": "^11.3.0",
6263
"@types/lodash": "^4.14.168",
6364
"little-state-machine": "^4.1.0",
@@ -106,10 +107,9 @@
106107
"typescript": "^4.2.4"
107108
},
108109
"peerDependencies": {
109-
"@emotion/react": ">=11.0.0",
110110
"react": ">=17.0.2",
111111
"react-dom": ">=17.0.2",
112-
"react-hook-form": "^7.13.0"
112+
"react-hook-form": "^7.33.1"
113113
},
114114
"husky": {
115115
"hooks": {

src/devTool.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { StateMachineProvider, createStore } from 'little-state-machine';
3-
import { Control, useFormContext } from 'react-hook-form';
3+
import { Control, FieldValues, useFormContext } from 'react-hook-form';
44
import { DevToolUI } from './devToolUI';
55
import type { PLACEMENT } from './position';
66

@@ -19,8 +19,8 @@ if (typeof window !== 'undefined') {
1919
);
2020
}
2121

22-
export const DevTool = (props?: {
23-
control?: Control<any>;
22+
export const DevTool = <T extends FieldValues>(props?: {
23+
control?: Control<T>;
2424
placement?: PLACEMENT;
2525
}) => {
2626
const methods = useFormContext();

yarn.lock

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,17 @@
15111511
"@emotion/utils" "0.11.3"
15121512
"@emotion/weak-memoize" "0.2.5"
15131513

1514+
"@emotion/cache@^11.1.3":
1515+
version "11.1.3"
1516+
resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.1.3.tgz#c7683a9484bcd38d5562f2b9947873cf66829afd"
1517+
integrity sha512-n4OWinUPJVaP6fXxWZD9OUeQ0lY7DvtmtSuqtRWT0Ofo/sBLCVSgb4/Oa0Q5eFxcwablRKjUXqXtNZVyEwCAuA==
1518+
dependencies:
1519+
"@emotion/memoize" "^0.7.4"
1520+
"@emotion/sheet" "^1.0.0"
1521+
"@emotion/utils" "^1.0.0"
1522+
"@emotion/weak-memoize" "^0.2.5"
1523+
stylis "^4.0.3"
1524+
15141525
"@emotion/core@^10.1.1":
15151526
version "10.1.1"
15161527
resolved "https://registry.yarnpkg.com/@emotion/core/-/core-10.1.1.tgz#c956c1365f2f2481960064bcb8c4732e5fb612c3"
@@ -1566,6 +1577,19 @@
15661577
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.5.tgz#2c40f81449a4e554e9fc6396910ed4843ec2be50"
15671578
integrity sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ==
15681579

1580+
"@emotion/react@^11.1.5":
1581+
version "11.1.5"
1582+
resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.1.5.tgz#15e78f9822894cdc296e6f4e0688bac8120dfe66"
1583+
integrity sha512-xfnZ9NJEv9SU9K2sxXM06lzjK245xSeHRpUh67eARBm3PBHjjKIZlfWZ7UQvD0Obvw6ZKjlC79uHrlzFYpOB/Q==
1584+
dependencies:
1585+
"@babel/runtime" "^7.7.2"
1586+
"@emotion/cache" "^11.1.3"
1587+
"@emotion/serialize" "^1.0.0"
1588+
"@emotion/sheet" "^1.0.1"
1589+
"@emotion/utils" "^1.0.0"
1590+
"@emotion/weak-memoize" "^0.2.5"
1591+
hoist-non-react-statics "^3.3.1"
1592+
15691593
"@emotion/serialize@^0.11.15", "@emotion/serialize@^0.11.16":
15701594
version "0.11.16"
15711595
resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-0.11.16.tgz#dee05f9e96ad2fb25a5206b6d759b2d1ed3379ad"
@@ -1577,7 +1601,7 @@
15771601
"@emotion/utils" "0.11.3"
15781602
csstype "^2.5.7"
15791603

1580-
"@emotion/serialize@^1.0.2":
1604+
"@emotion/serialize@^1.0.0", "@emotion/serialize@^1.0.2":
15811605
version "1.0.2"
15821606
resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.0.2.tgz#77cb21a0571c9f68eb66087754a65fa97bfcd965"
15831607
integrity sha512-95MgNJ9+/ajxU7QIAruiOAdYNjxZX7G2mhgrtDWswA21VviYIRP1R5QilZ/bDY42xiKsaktP4egJb3QdYQZi1A==
@@ -1593,6 +1617,11 @@
15931617
resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-0.9.4.tgz#894374bea39ec30f489bbfc3438192b9774d32e5"
15941618
integrity sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==
15951619

1620+
"@emotion/sheet@^1.0.0", "@emotion/sheet@^1.0.1":
1621+
version "1.0.1"
1622+
resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.0.1.tgz#245f54abb02dfd82326e28689f34c27aa9b2a698"
1623+
integrity sha512-GbIvVMe4U+Zc+929N1V7nW6YYJtidj31lidSmdYcWozwoBIObXBnaJkKNDjZrLm9Nc0BR+ZyHNaRZxqNZbof5g==
1624+
15961625
"@emotion/styled-base@^10.0.27":
15971626
version "10.0.31"
15981627
resolved "https://registry.yarnpkg.com/@emotion/styled-base/-/styled-base-10.0.31.tgz#940957ee0aa15c6974adc7d494ff19765a2f742a"
@@ -1642,7 +1671,7 @@
16421671
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.0.0.tgz#abe06a83160b10570816c913990245813a2fd6af"
16431672
integrity sha512-mQC2b3XLDs6QCW+pDQDiyO/EdGZYOygE8s5N5rrzjSI4M3IejPE/JPndCBwRT9z982aqQNi6beWs1UeayrQxxA==
16441673

1645-
"@emotion/[email protected]":
1674+
"@emotion/[email protected]", "@emotion/weak-memoize@^0.2.5":
16461675
version "0.2.5"
16471676
resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46"
16481677
integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==
@@ -7021,7 +7050,7 @@ hmac-drbg@^1.0.1:
70217050
minimalistic-assert "^1.0.0"
70227051
minimalistic-crypto-utils "^1.0.1"
70237052

7024-
hoist-non-react-statics@^3.3.0:
7053+
hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1:
70257054
version "3.3.2"
70267055
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
70277056
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==

0 commit comments

Comments
 (0)