react-haiku icon indicating copy to clipboard operation
react-haiku copied to clipboard

feat(hooks): Create `useDevToolsDetector` hook with tests and docs

Open MohakBajaj opened this issue 4 months ago • 0 comments

This PR introduces a new hook, useDevToolsDetector, designed to detect whether the browser's developer tools are open.

It uses a non-blocking Web Worker to provide a reliable, performant, and continuous check without impacting the main thread's performance.

Usage

import { useDevToolsDetector } from 'react-haiku;

const MyComponent = () => {
  const isDevToolsOpen = useDevToolsDetector();
  return <div>DevTools Open: {isDevToolsOpen ? 'Yes' : 'No'}</div>;
}

MohakBajaj avatar Sep 11 '25 21:09 MohakBajaj