devtools
devtools copied to clipboard
Add enable props
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"}
/>
);
To figure out the build at the run time is a bit trigger, maybe we should produce a build which also has the Devtool even at prod build.
maybe we should produce a build which also has the Devtool even at prod build.
Sounds good. I checked this issue. https://github.com/react-hook-form/devtools/issues/18 Probably to build Devtool even at production build is cause issue about performance. Has that issue already solve?
That issue is already resolved.
I'd like to try this issue. So.. what can I do?