File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,12 @@ - (void)prepareView {
4242 __typeof__ (self) strongSelf = weakSelf;
4343
4444 if (strongSelf != nullptr && strongSelf->_eventEmitter != nullptr ) {
45+ NSString *trackUserLocation = event[@" trackUserLocation" ];
46+
4547 facebook::react::MLRNCameraEventEmitter::OnTrackUserLocationChange eventStruct{
46- [event[@" trackUserLocation" ] UTF8String ],
48+ [trackUserLocation isKindOfClass: [NSString class ]]
49+ ? folly::dynamic ([trackUserLocation UTF8String ])
50+ : folly::dynamic (nullptr ),
4751 };
4852 std::dynamic_pointer_cast<const facebook::react::MLRNCameraEventEmitter>(
4953 strongSelf->_eventEmitter )
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export interface CameraRef {
191191export type TrackUserLocation = "default" | "heading" | "course" ;
192192
193193export type TrackUserLocationChangeEvent = {
194- trackUserLocation ? : TrackUserLocation ;
194+ trackUserLocation : TrackUserLocation | null ;
195195} ;
196196
197197export type CameraProps = BaseProps &
@@ -299,11 +299,7 @@ export const Camera = memo(
299299 maxZoom = { maxZoom }
300300 maxBounds = { maxBounds }
301301 trackUserLocation = { trackUserLocation }
302- onTrackUserLocationChange = {
303- onTrackUserLocationChange as (
304- event : NativeSyntheticEvent < { trackUserLocation ?: string } > ,
305- ) => void
306- }
302+ onTrackUserLocationChange = { onTrackUserLocationChange }
307303 />
308304 ) ;
309305 } ,
Original file line number Diff line number Diff line change 55 type ViewProps ,
66} from "react-native" ;
77
8+ import type { UnsafeMixed } from "../../types/codegen/UnsafeMixed" ;
9+
810// START: NativeCameraStop
911type NativeViewPadding = {
1012 top ?: CodegenTypes . WithDefault < CodegenTypes . Int32 , 0 > ;
@@ -36,7 +38,10 @@ type NativeCameraStop = NativeViewState & {
3638type NativeTrackUserLocationMode = "none" | "default" | "heading" | "course" ;
3739
3840type TrackUserLocationChangeEvent = {
39- trackUserLocation ?: string ;
41+ trackUserLocation : UnsafeMixed < Exclude <
42+ NativeTrackUserLocationMode ,
43+ "none"
44+ > | null > ;
4045} ;
4146
4247export interface NativeProps extends ViewProps {
You can’t perform that action at this time.
0 commit comments