You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stupid question maybe but what happens with the DevTools component that I have in my forms when I deploy to production?
I have "@hookform/devtools": "^4.3.1", in my devDependencies in package.json but won't my app break in production wherever I'm referencing @hookform/devtools?
The text was updated successfully, but these errors were encountered:
So in the case of this particular package, you can likely accomplish the same thing with the below code (untested)
exportconstHookFormDevtools=process.env.NODE_ENV==='production'
? ()=>null// Render nothing in production
: React.lazy(()=>// Lazy load in developmentimport('@hookform/devtools').then((res)=>({default: res.DevTool})),)
Note: I am not a maintainer of this library, this just seems like a common approach that would work in the case of these dev tools, similar to others.
Hi,
Stupid question maybe but what happens with the DevTools component that I have in my forms when I deploy to production?
I have "@hookform/devtools": "^4.3.1", in my devDependencies in package.json but won't my app break in production wherever I'm referencing @hookform/devtools?
The text was updated successfully, but these errors were encountered: