chrisdrackett / react-mapkit

React wrapper for Apple's mapkit.js.
https://chrisdrackett.github.io/react-mapkit/?selectedStory=all%20props&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybooks%2Fstorybook-addon-knobs
MIT License
76 stars 26 forks source link

Some updates that makes this library to work with the newest React versions + some bug fixes #92

Open MohaElder opened 2 years ago

MohaElder commented 2 years ago
  1. It seems that in newer versions of React(e.g: 18.x.x), you need to use PropsWithChildren to wrap your function or else there will be Property 'children' does not exist on type 'IntrinsicAttributes & Props' error.

reference: Answer from StackOverflow

  1. I noticed that there are missing prop type definitions in Marker (title & subtitle) and Map (tintColor). I have added them.
MohaElder commented 2 years ago

Hi! I saw your comment on this closed PR that explained why you don't want to upgrade library's React related specifications to ensure its compatibility with older React versions. But I was wondering if it is possible to have a seperate version of this library that supports newer react versions since the current library crashes on newer react versions. If possible, I could help with that! Thanks for the time reading this~

chrisdrackett commented 2 years ago

I think this library could probably be updates to both not crash and work on older react versions :D

I plan on circling back to this library soon as I need it for an upcoming project. In the meantime I'm happy to accept PRs.