diff options
| author | Jacob Richman <[email protected]> | 2025-08-12 14:05:49 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-12 21:05:49 +0000 |
| commit | d219f9013206aad5a1361e436ad4a45114e9cd49 (patch) | |
| tree | 58216dc659e809bc896b03de21a9a1c713126d6b /packages/cli/src/ui/components/DebugProfiler.tsx | |
| parent | 74fd0841d0d7148127e586fce4c550a01ff40e90 (diff) | |
Switch from useInput to useKeypress. (#6056)
Diffstat (limited to 'packages/cli/src/ui/components/DebugProfiler.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/DebugProfiler.tsx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/cli/src/ui/components/DebugProfiler.tsx b/packages/cli/src/ui/components/DebugProfiler.tsx index 89c40a91..22c16cfb 100644 --- a/packages/cli/src/ui/components/DebugProfiler.tsx +++ b/packages/cli/src/ui/components/DebugProfiler.tsx @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { Text, useInput } from 'ink'; +import { Text } from 'ink'; import { useEffect, useRef, useState } from 'react'; import { Colors } from '../colors.js'; +import { useKeypress } from '../hooks/useKeypress.js'; export const DebugProfiler = () => { const numRenders = useRef(0); @@ -16,11 +17,14 @@ export const DebugProfiler = () => { numRenders.current++; }); - useInput((input, key) => { - if (key.ctrl && input === 'b') { - setShowNumRenders((prev) => !prev); - } - }); + useKeypress( + (key) => { + if (key.ctrl && key.name === 'b') { + setShowNumRenders((prev) => !prev); + } + }, + { isActive: true }, + ); if (!showNumRenders) { return null; |
