……/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m:8:41 Incompatible function pointer types passing 'YGSize (YGNodeConstRef, float, YGMeasureMode, float, YGMeasureMode)' (aka 'struct YGSize (const struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)') to parameter of type 'YGMeasureFunc' (aka 'struct YGSize (*)(struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)')
Xcode에서 ios 빌드하려고 하면 에러가 뜬다...!!ㅇㅁㅇ!!!
문제 원인 : ReactNative 0.72 이상, 혹은 최신 Yoga 엔진에서는 measure 함수의 첫 번째 인자 타입이 바뀌었다고 합니다.
예전에는 YGNodeConstRef였지만,
최신 버전에서는 YGNodeRef로 바꿔야 에러가 나지 않습니다.
에러가 발생하는 파일에서 YGNodeConstRef를 검색하여 YGNodeRef로 바꾸면 해결!
예시)
수정 전 :
static YGSize RNDateTimePickerShadowViewMeasure(
YGNodeConstRef node, //이거를
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode
)
수정 후 :
static YGSize RNDateTimePickerShadowViewMeasure(
YGNodeRef node, //이렇게!!
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode
)
다시 빌드를 하면 에러 나지 않는다.