iOS crash when using surface
Using the surface prop causes an immediate crash on iOS.
Environment
- React Native:
0.87
@swmansion/react-native-bottom-sheet: 0.16.2
- iOS / New Architecture
Error
`RCTViewComponentView` subclasses (and `BottomSheetSurfaceComponentView` particularly) must setup `_props` instance variable with a default value in the constructor.
Reproduction
<BottomSheet
detents={[0, 300, 600]}
index={index}
surface={<View style={StyleSheet.absoluteFill} />}
>
<View />
</BottomSheet>
Removing the surface prop prevents the crash.
It looks like BottomSheetSurfaceComponentView does not initialize _props in its constructor, while BottomSheetComponentView does.
Possibly something like this is missing:
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
static const auto defaultProps =
std::make_shared<const BottomSheetSurfaceViewProps>();
_props = defaultProps;
}
return self;
}
Android does not seem to be affected.
iOS crash when using
surfaceUsing the
surfaceprop causes an immediate crash on iOS.Environment
0.87@swmansion/react-native-bottom-sheet:0.16.2Error
Reproduction
Removing the
surfaceprop prevents the crash.It looks like
BottomSheetSurfaceComponentViewdoes not initialize_propsin its constructor, whileBottomSheetComponentViewdoes.Possibly something like this is missing:
Android does not seem to be affected.