Fix for incompatible function pointer types passing 'YGSize'
yagnesh97 opened this issue Β· comments
Yagnesh commented
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch @react-native-community/datetimepicker@7.6.1
for the project I'm working on.
Error:
Incompatible function pointer types passing 'YGSize (YGNodeRef, float, YGMeasureMode, float, YGMeasureMode)' (aka 'struct YGSize (struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)') to parameter of type 'YGMeasureFunc' (aka 'struct YGSize (*)(const struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)')
Here is the diff that solved my problem:
diff --git a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
index c139440..4ff3362 100644
--- a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
+++ b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
@@ -41,7 +41,7 @@ - (void)setTimeZoneName:(NSString *)timeZoneName {
YGNodeMarkDirty(self.yogaNode);
}
-static YGSize RNDateTimePickerShadowViewMeasure(YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
+static YGSize RNDateTimePickerShadowViewMeasure(YGNodeConstRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
{
RNDateTimePickerShadowView *shadowPickerView = (__bridge RNDateTimePickerShadowView *)YGNodeGetContext(node);
This issue body was partially generated by patch-package.
Joshua Barnes commented
Sachin Mishra commented
@JoshBarnesD its not working with latest (8.1.0). i have update my xcode 15.3 to 15.4 after that this issue is occurred.
Sachin Mishra commented
Christian commented
I can confirm that this issue happens with Xcode 15.4 and RNDateTimePicker (8.1.0) as shown in this comment. It seems that the applied patch needs to be reverted again.