Skip to content

enabled ​

Package: @autotracer/react19  ·  Layer: Runtime  ·  Type: boolean  ·  Default: false


enabled is a runtime configuration option for reactTracer() - the initializer of the @autotracer/react19 React component render tracing library. It selects whether tracing begins active or dormant during initialization. The default is false, so ReactTracer starts dormant unless you opt into immediate startup. While tracing is inactive, useReactTracer() is a no-op that still preserves React's rules of hooks.

Set enabled: true when you want tracing to start immediately during bootstrap. Omit it, or leave it false, when you want a dormant startup and plan to turn tracing on later.

If a saved enabled-on-load preference already exists from the Dashboard or globalThis.autoTracer.reactTracer.setEnabledOnLoad(...), ReactTracer applies that saved value on the first initialization for the page load.

After initialization, live activity is controlled separately from this startup option. Use the Dashboard workflow as the normal control surface in browser-based internal web apps when that workflow is mounted. The lower-level globalThis.autoTracer.reactTracer.start(), stop(), and isEnabled() controls remain useful in tests, automation, and other non-Dashboard setups. Starting a dormant tracer activates useReactTracer() collection without changing the stored enabled: false option. See Runtime Control.

updateReactTracerOptions({ enabled: false }) stops active tracing only when the option changes from true to false. If tracing was started while the stored option was already false, call the Dashboard stop command or globalThis.autoTracer.reactTracer.stop() instead.

Read together with outputMode and colors when you are tuning whether tracing starts and how the output should look.

When To Set It ​

  • Set true when you want tracing to begin immediately at app startup.
  • Leave it omitted, or set false, when you want startup to stay dormant and tracing to begin later through the Dashboard or globalThis.autoTracer.

Usage ​

typescript
import { reactTracer } from "@autotracer/react19";

reactTracer({
  enabled: true,
});

Released under the MIT License.