fix: datatype mismatch causes crash#4143
Conversation
|
Thanks much, Can you please add a demo component to reproduce the issue?! |
|
@mfazekas Sadly I'll not have a chance to do so in the the foreseeable future. |
|
Confirmed the issue and verified the fix. The crash happens because the TurboModule spec ( Added a reproducer example to the example app: Reproducer: Camera/MoveAndScale.tsximport { useRef } from 'react';
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
import { MapView, Camera, type CameraRef } from '@rnmapbox/maps';
const styles = StyleSheet.create({
container: { flex: 1 },
map: { flex: 1 },
buttons: {
position: 'absolute',
bottom: 40,
left: 20,
right: 20,
gap: 8,
},
button: {
backgroundColor: 'rgba(255, 255, 255, 0.95)',
padding: 14,
borderRadius: 8,
alignItems: 'center',
},
buttonText: { fontSize: 14, fontWeight: '600' },
});
const MoveAndScale = () => {
const cameraRef = useRef<CameraRef>(null);
return (
<View style={styles.container}>
<MapView style={styles.map}>
<Camera
ref={cameraRef}
defaultSettings={{
centerCoordinate: [-74.006, 40.7128],
zoomLevel: 12,
}}
/>
</MapView>
<View style={styles.buttons}>
<TouchableOpacity
style={styles.button}
onPress={() => cameraRef.current?.moveBy({ x: 100, y: 0 })}
>
<Text style={styles.buttonText}>moveBy (no animation)</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() =>
cameraRef.current?.moveBy({
x: 0, y: -100,
animationMode: 'easeTo',
animationDuration: 500,
})
}
>
<Text style={styles.buttonText}>moveBy (animated 500ms)</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() =>
cameraRef.current?.scaleBy({ x: 200, y: 400, scaleFactor: 2 })
}
>
<Text style={styles.buttonText}>scaleBy 2x (no animation)</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() =>
cameraRef.current?.scaleBy({
x: 200, y: 400, scaleFactor: 0.5,
animationMode: 'easeTo',
animationDuration: 500,
})
}
>
<Text style={styles.buttonText}>scaleBy 0.5x (animated 500ms)</Text>
</TouchableOpacity>
</View>
</View>
);
};
export default MoveAndScale;Crash occurs at Cherry-picked and verified the fix works — all 4 variants (moveBy/scaleBy with and without animation) work correctly after the change. |
|
Thank you very much @mfazekas 🙂 |
Description
While switching to new architecture we spotted this issue:

Which this PR fixes. :)