UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

16 lines 834 B
/** * Runs an effect only in development. Wrapping `useEffect` in a regular hook * with an outer `__DEV__` guard keeps the production cost to zero (the entire * call is dropped by the consumer's `process.env.NODE_ENV` replacement) while * centralising the `eslint-disable react-hooks/rules-of-hooks` to one place * instead of every call site. * * `exhaustive-deps` is wired up to also check call sites of this hook via * `additionalEffectHooks` in `eslint.config.mjs`, so callers get the same * deps lint they would for a plain `useEffect`. * * @param effect The effect callback to run in development. * @param deps Dependency list, same semantics as `useEffect`. */ export declare const useDevOnlyEffect: (effect: React.EffectCallback, deps?: React.DependencyList) => void; //# sourceMappingURL=useDevOnlyEffect.d.ts.map