({ nativeEvent })
| 12 | const [isPressed, setIsPressed] = useState(false); |
| 13 | |
| 14 | const handleKeyPress = ({ nativeEvent }) => { |
| 15 | if (nativeEvent.key === key) { |
| 16 | setIsPressed(true); |
| 17 | // Perform actions when Delete or Backspace is pressed |
| 18 | console.log('Delete or Backspace key pressed!'); |
| 19 | } else { |
| 20 | setIsPressed(false); |
| 21 | } |
| 22 | }; |
| 23 | |
| 24 | return { |
| 25 | isPressed, |
nothing calls this directly
no outgoing calls
no test coverage detected