Skip to content

labelHooks

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


labelHooks is a build configuration option passed to @autotracer/plugin-babel-react18 in your Babel config. 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

javascript
{
  "plugins": [
    [
      "@autotracer/plugin-babel-react18",
      { "labelHooks": ["useState", "useReducer", "useSelector"] }
    ]
  ]
}

Released under the MIT License.