score:0

Accepted answer

i just updated both d3js and types,

npm i d3@latest @types/d3@latest

this solved the issue. now event is the first parameter of the event listener callback function.

score:2

event is part of d3-selection and only exported in the v1 of @types/d3-selection. running yarn list/npm list, you'll see that "@types/d3": "5.7.4" dependency for d3-selection is @types/d3-selection@*, which is actually defaulted to v2.

screenshot of @types/d3 dependency list

solution is to include "@types/d3-selection": "^1.0.0" in dependencies


Related Query