Rendering

DEV

Edit this page
const DEV: object | undefined

On the client, Solid provides (via conditional exports) different builds depending on whether the development condition is set. Development mode provides some additional checking — e.g. detecting accidental use of multiple instances of Solid — which are removed in production builds.

If you want code to run only in development mode (most useful in libraries), you can check whether the DEV export is defined. Note that it is always defined on the server, so you may want to combine with isServer:

import { DEV } from "solid-js";
import { isServer } from "solid-js/web";
if (DEV && !isServer) {
console.log(...);
}
Report an issue with this page