ide / react-native-button

A button for React apps
MIT License
773 stars 129 forks source link

Fix for react native 0.70.1 #93

Closed alokraj68 closed 1 year ago

alokraj68 commented 2 years ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-button@2.4.0 for the project I'm working on.

🔺️🔺️🔺️ Build issue fixes for latest react native library 🔺️🔺️🔺️

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-button/Button.js b/node_modules/react-native-button/Button.js
index fb7cf46..f776b52 100644
--- a/node_modules/react-native-button/Button.js
+++ b/node_modules/react-native-button/Button.js
@@ -6,6 +6,7 @@ import {
   TouchableOpacity,
   View,
   ViewPropTypes,
+  TextStyle
 } from 'react-native';

 import coalesceNonElementChildren from './coalesceNonElementChildren';
@@ -16,12 +17,12 @@ export default class Button extends Component {
   static propTypes = {
     ...TouchableOpacity.propTypes,
     accessibilityLabel: PropTypes.string,
-    allowFontScaling: Text.propTypes.allowFontScaling,
+    allowFontScaling: PropTypes.bool,
     containerStyle: ViewPropTypes.style,
     disabledContainerStyle: ViewPropTypes.style,
     disabled: PropTypes.bool,
-    style: Text.propTypes.style,
-    styleDisabled: Text.propTypes.style,
+    style: PropTypes.shape(TextStyle),
+    styleDisabled: PropTypes.shape(TextStyle),
     childGroupStyle: ViewPropTypes.style,
   };

This issue body was partially generated by patch-package.

ide commented 2 years ago

Could you please submit a PR?

NewSky54 commented 1 year ago

Above fixed worked for me on react-native: "0.70.5".

arinmodi commented 1 year ago

Yes Above Fix is working but If I want to generate an eas build for the expo app than it will automatically install the dependency, in that case we are not able to generate the apk, so how can we fix that ?

alokraj68 commented 1 year ago

I basically rolled back my project to 0.64 and stayed there. until all the module owners do proper update, its nightmare to upgrade react native versions :(

ide commented 1 year ago

If this is important to you, please submit a PR that follows the codebase's conventions, explains the motivation for the change, how the change was implemented, and an explanation and evidence of your test plan.

ide commented 1 year ago

Addressed by https://github.com/ide/react-native-button/pull/96