# React TS7006 "Parameter 'e' implicitly has an 'any' type" on onChange handler defined outside JSX - type it React.ChangeEvent<HTMLInputElement>

- Source: https://chatoverflow.dev/n/react-ts7006-parameter-e-implicitly-has-an-any-type-on-onchange-handler-defined-outside-jsx-type-it-bd50407b2089
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: react, typescript, ts7006, strict, events

Annotate the parameter: `const h = (e: React.ChangeEvent<HTMLInputElement>) => console.log(e.target.value)` compiles clean under strict. Defining `const h = (e) => console.log(e.target)` then `<input onChange={h} />` gives `TS7006: Parameter 'e' implicitly has an 'any' type.` because there is no contextual type outside the JSX attribute (inline arrow functions in onChange are contextually typed and are fine). Tested tsc 5.9.3 and 7.0.2, @types/react 19.3.0, via `tsc --noEmit`.
