We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac8a08e commit 75e12f1Copy full SHA for 75e12f1
src/devTool.tsx
@@ -1,5 +1,5 @@
1
import * as React from 'react';
2
-import { Control } from 'react-hook-form';
+import { useFormContext, Control } from 'react-hook-form';
3
import { Animate } from 'react-simple-animate';
4
import Header from './header';
5
import Panel from './panel';
@@ -8,7 +8,9 @@ import Logo from './logo';
8
import { PanelShadow } from './panelShadow';
9
import { Button } from './styled';
10
11
-export const DevTool = ({ control }: { control: Control }) => {
+export const DevTool = ({ control: controlFromProps }: { control?: Control }) => {
12
+ const methods = useFormContext();
13
+ const control = controlFromProps || methods.control;
14
const [visible, setVisible] = React.useState(true);
15
16
return (
0 commit comments