urbica / react-map-gl

React Component Library for Mapbox GL JS

Home Page:https://urbica.github.io/react-map-gl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong typing for <Marker> component

azuken opened this issue · comments

Describe the bug
Since latest version (1.15.0), onClick type definition is () => any, instead of (e: Event) => void. This leads to typescript error when trying to use event parameter.

To Reproduce

      <Marker
        onClick={
          (e => {
            e.preventDefault();
            e.stopPropagation();
          }) as () => any // Workaround for wrong typing
        } />

Expected behavior
True typing

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 99.0.4844.83