Skip to content

Add enable props #61

@tyankatsu0105

Description

@tyankatsu0105

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"}
  />
);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions