DOM events

onKeyUp

Runs when a key is released while the element is the event target or ancestor. Key release is not a dependable global cleanup if focus has moved; avoid using it as the sole source of held-key state.

Formal Syntax & Structure

react syntaxreact
onKeyUp={handler}

Working Example

Example Snippetreact
export default function App() { return <label>Tool<input onKeyUp={e=>{if(e.key==='Escape')console.log('Escape released');}}/></label>; }
React Reference