Skip to content

labelHooks

Package: @autotracer/plugin-vite-react18  ·  Layer: Build  ·  Type: string[]  ·  Default: []


labelHooks is a build configuration option for reactTracer.vite() — the Vite plugin initializer of the @autotracer/plugin-vite-react18 React build-time injection package. It lists hook names that should always receive automatic labels.

These hook names are labeled even if they do not match labelHooksPattern. Use this when you want to guarantee labels for a known set of hooks.

Read together with labelHooksPattern when you are tuning automatic hook labeling.

Usage

typescript
reactTracer.vite({
  labelHooks: ["useState", "useReducer", "useSelector"],
});

Released under the MIT License.