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

figure out best way to handle controlled / uncontrolled issues #7

Closed chrisdrackett closed 6 years ago

chrisdrackett commented 6 years ago

Right now its possible to set the map center, span, rotation, or rect via props. However, if the user is able to pan, rotate or zoom the map the values of these props are more defaults.

Worse, at the moment if these props change they will reset the map view, which might not be desired.

Maybe these values should not be props, but setter functions provided by the component?

chrisdrackett commented 6 years ago

added the concept of default props and using the function as child pattern to provide hooks for setting center and rotation