labelHooksPattern
Package: @autotracer/inject-react18 · Layer: Build · Type: string · Default: "^use[A-Z].*"
labelHooksPattern is a shared transform configuration option used when transform() decides which additional hook names should get labelState(...) injections. The value is treated as a JavaScript regular-expression pattern string, not as a regex literal.
Before creating the RegExp, the transform strips an accidental leading slash and trailing slash-plus-flags. An empty string disables pattern matching so that only the exact names from labelHooks and the built-in useState and useReducer cases are labeled.
The pattern matches the hook identifier in a direct call or the property name in a non-computed member call. For example, placesApi.useSearchPlacesQuery() is matched as useSearchPlacesQuery, so the default pattern labels its assigned result. The original call and receiver are preserved. Computed member calls such as api[hookName]() and optional calls are not labeled.
Usage
import { normalizeConfig } from "@autotracer/inject-react18";
const config = normalizeConfig({
labelHooksPattern: "^use(Selector|Dispatch)$",
});Read together with labelHooks because both settings contribute to the additional hook-matching set.