react-mapkit icon indicating copy to clipboard operation
react-mapkit copied to clipboard

Wrong typing for useMap props?

Open eivindml opened this issue 4 years ago • 4 comments

I'm using the useMap() hook, and I'm following the sample code from the README to add a default center location. But typescript gives my an error, says I'm missing some props.

I guess the props for the useMap hook is not properly defined?

Skjermbilde 2021-01-17 kl  12 00 56

eivindml avatar Jan 17 '21 11:01 eivindml

we're having the same exact issue

NadGuar avatar Nov 16 '21 13:11 NadGuar

working on this a bit today, I'll see if I can find and fix this!

chrisdrackett avatar Nov 18 '21 17:11 chrisdrackett

I'm not able to reproduce this. Can you create a breaking example and/or provide more code?

chrisdrackett avatar Nov 18 '21 18:11 chrisdrackett

Hi Chris. Here is a Codepen showing what is happening: link. Actually we are not understanding what's going on here: basically seems that TS isn't able to infer all the constructor props you provided in utils.ts, not only about MapConstructionOptions (line 7 of codepen link provided above) but also MarkerConstructionOptions (line 22). Thank you for your work!

catruzz avatar Nov 19 '21 14:11 catruzz