Closed kyasu1 closed 7 years ago
I have been working on the integration of react-native-maps, and it is working pretty well. In that process I realized the needs of ref property for supporting imperative methods.
ref
The actual usage is like follows.
const _ohanhi$elm_native_ui$Native_NativeUi_MapView = function () { const map = require('react-native-maps'); const maps = {}; function refMap(el) { maps[el.props.id] = el; } function animateToRegion(id, region, duration) { return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) { maps[id].animateToRegion(region, duration); return callback(_elm_lang$core$Native_Scheduler.succeed(unit)); }); } return { map: map, refMap: refMap, animateToRegion: F3(animateToRegion), }; }();
Okay, this seems good to me. Thanks, @kyasu1!
I have been working on the integration of react-native-maps, and it is working pretty well. In that process I realized the needs of
ref
property for supporting imperative methods.The actual usage is like follows.