-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Labels
Description
Hi.
I love this devtools. Thanks for all contributors!
Currently, this devtools UI are included application ifNODE_ENV is NOT production.
But, I think people who want to create an application as experimental wants to enable devtools UI in production build.
I'm one of them.
https://sandbox-redux-toolkit-create-entity-adapter.vercel.app/
(In this case, I wroteimport * as ReactHookFormDevTool from '@hookform/devtools/dist/index.cjs.development.js'; https://github.com/tyankatsu0105/sandbox-redux-toolkit-create-entity-adapter/blob/15e845c47090a03e5baf0d4ab8306ae651ea19ce/apps/client/components/create/add-one/add-one.container.tsx#L5)
So, I propose props enable: boolean to <DevTool />
Like this:
import * as ReactHookFormDevTool from "@hookform/devtools/dist/index.cjs.development.js";
export const Component = () => (
<ReactHookFormDevTool.DevTool control={control} enable />
);
// or
export const Component = () => (
<ReactHookFormDevTool.DevTool
control={control}
enable={NODE_ENV === "production"}
/>
);