Tree-shake DevTools for Production
mainSince jotai-devtools is intended for development, you should prevent it from being included in your production bundle.
Vite
Use process.env.NODE_ENV to conditionally render the component and import the CSS inline using the ?inline suffix.
Next.js
Use next/dynamic with ssr: false to load the DevTools component only when process.env.NODE_ENV !== 'production'.
// Vite Example
import { DevTools } from 'jotai-devtools';
import css from 'jotai-devtools/styles.css?inline';
const JotaiDevTools = () =>
process.env.NODE_ENV !== 'production' ? (
<>
<style>{css}</style>
<DevTools />
</>
) : null;