axelra-ag / react-native-animateable-text

🆎 A fork of React Native's <Text/> component that supports Animated Values!
https://www.npmjs.com/package/react-native-animateable-text
MIT License
360 stars 27 forks source link

Problem building project on older react native versions #51

Open Fannolo opened 2 months ago

Fannolo commented 2 months ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-animateable-text@0.12.1 for the project I'm working on.

Xcode version 15.4 react-native-animateable-text@12.1 "react-native": "^0.72.10",

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-animateable-text/ios/JBBaseTextShadowView.m b/node_modules/react-native-animateable-text/ios/JBBaseTextShadowView.m
index 4f57cf1..aebce33 100644
--- a/node_modules/react-native-animateable-text/ios/JBBaseTextShadowView.m
+++ b/node_modules/react-native-animateable-text/ios/JBBaseTextShadowView.m
@@ -14,7 +14,7 @@

 NSString *const JBBaseTextShadowViewEmbeddedShadowViewAttributeName = @"JBBaseTextShadowViewEmbeddedShadowViewAttributeName";

-static void RCTInlineViewYogaNodeDirtied(YGNodeConstRef node)
+static void RCTInlineViewYogaNodeDirtied(YGNodeRef node)
 {
   // An inline view (a view nested inside of a text node) does not have a parent
   // in the Yoga tree. Consequently, we have to manually propagate the inline
diff --git a/node_modules/react-native-animateable-text/ios/JBTextShadowView.m b/node_modules/react-native-animateable-text/ios/JBTextShadowView.m
index fd7d0cf..651181e 100644
--- a/node_modules/react-native-animateable-text/ios/JBTextShadowView.m
+++ b/node_modules/react-native-animateable-text/ios/JBTextShadowView.m
@@ -385,7 +385,7 @@ - (CGFloat)lastBaselineForSize:(CGSize)size
   return size.height + maximumDescender;
 }

-static YGSize RCTTextShadowViewMeasure(YGNodeConstRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
+static YGSize RCTTextShadowViewMeasure(YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
 {
   CGSize maximumSize = (CGSize){
     widthMode == YGMeasureModeUndefined ? CGFLOAT_MAX : RCTCoreGraphicsFloatFromYogaFloat(width),
@@ -422,7 +422,7 @@ static YGSize RCTTextShadowViewMeasure(YGNodeConstRef node, float width, YGMeasu
   };
 }

-static float RCTTextShadowViewBaseline(YGNodeConstRef node, const float width, const float height)
+static float RCTTextShadowViewBaseline(YGNodeRef node, const float width, const float height)
 {
   JBTextShadowView *shadowTextView = (__bridge JBTextShadowView *)YGNodeGetContext(node);

This issue body was partially generated by patch-package.