From c7df1bc011f3b2aa66907e5b7bdc641379f1487b Mon Sep 17 00:00:00 2001 From: Ahmed Elsayed Date: Fri, 13 Oct 2023 16:27:45 +0200 Subject: [PATCH] fix(floating-action-button): use native driver warning --- ...e-action-button-npm-2.8.5-bcd65e566e.patch | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 .yarn/patches/react-native-action-button-npm-2.8.5-bcd65e566e.patch diff --git a/.yarn/patches/react-native-action-button-npm-2.8.5-bcd65e566e.patch b/.yarn/patches/react-native-action-button-npm-2.8.5-bcd65e566e.patch new file mode 100644 index 000000000..fb0a0578f --- /dev/null +++ b/.yarn/patches/react-native-action-button-npm-2.8.5-bcd65e566e.patch @@ -0,0 +1,109 @@ +diff --git a/ActionButton.js b/ActionButton.js +index b8306c2efb2460d4aa110e83d2e5410588f280de..890003d30fa5400f4778f5bb2dffa10e70fbe3ee 100644 +--- a/ActionButton.js ++++ b/ActionButton.js +@@ -16,6 +16,7 @@ import { + touchableBackground, + DEFAULT_ACTIVE_OPACITY + } from "./shared"; ++import { TextPropTypes } from 'deprecated-react-native-prop-types' + + export default class ActionButton extends Component { + constructor(props) { +@@ -39,11 +40,11 @@ export default class ActionButton extends Component { + clearTimeout(this.timeout); + } + +- componentWillReceiveProps(nextProps) { ++ UNSAFE_componentWillReceiveProps(nextProps) { + if (nextProps.resetToken !== this.state.resetToken) { + if (nextProps.active === false && this.state.active === true) { + if (this.props.onReset) this.props.onReset(); +- Animated.spring(this.anim, { toValue: 0 }).start(); ++ Animated.spring(this.anim, { toValue: 0, useNativeDriver: false }).start(); + setTimeout( + () => + this.setState({ active: false, resetToken: nextProps.resetToken }), +@@ -53,7 +54,7 @@ export default class ActionButton extends Component { + } + + if (nextProps.active === true && this.state.active === false) { +- Animated.spring(this.anim, { toValue: 1 }).start(); ++ Animated.spring(this.anim, { toValue: 1, useNativeDriver: false }).start(); + this.setState({ active: true, resetToken: nextProps.resetToken }); + return; + } +@@ -185,11 +186,11 @@ export default class ActionButton extends Component { + const parentStyle = isAndroid && + this.props.fixNativeFeedbackRadius + ? { +- right: this.props.offsetX, +- zIndex: this.props.zIndex, +- borderRadius: this.props.size / 2, +- width: this.props.size +- } ++ right: this.props.offsetX, ++ zIndex: this.props.zIndex, ++ borderRadius: this.props.size / 2, ++ width: this.props.size ++ } + : { marginHorizontal: this.props.offsetX, zIndex: this.props.zIndex }; + + return ( +@@ -263,7 +264,7 @@ export default class ActionButton extends Component { + + let actionButtons = !Array.isArray(children) ? [children] : children; + +- actionButtons = actionButtons.filter( actionButton => (typeof actionButton == 'object') ) ++ actionButtons = actionButtons.filter(actionButton => (typeof actionButton == 'object')) + + const actionStyle = { + flex: 1, +@@ -316,7 +317,7 @@ export default class ActionButton extends Component { + if (this.state.active) return this.reset(); + + if (animate) { +- Animated.spring(this.anim, { toValue: 1 }).start(); ++ Animated.spring(this.anim, { toValue: 1, useNativeDriver: false }).start(); + } else { + this.anim.setValue(1); + } +@@ -328,14 +329,14 @@ export default class ActionButton extends Component { + if (this.props.onReset) this.props.onReset(); + + if (animate) { +- Animated.spring(this.anim, { toValue: 0 }).start(); ++ Animated.spring(this.anim, { toValue: 0, useNativeDriver: false }).start(); + } else { + this.anim.setValue(0); + } + + setTimeout(() => { + if (this.mounted) { +- this.setState({ active: false, resetToken: this.state.resetToken }); ++ this.setState({ active: false, resetToken: this.state.resetToken }); + } + }, 250); + } +@@ -363,7 +364,7 @@ ActionButton.propTypes = { + bgColor: PropTypes.string, + bgOpacity: PropTypes.number, + buttonColor: PropTypes.string, +- buttonTextStyle: Text.propTypes.style, ++ buttonTextStyle: TextPropTypes.style, + buttonText: PropTypes.string, + + offsetX: PropTypes.number, +@@ -400,9 +401,9 @@ ActionButton.defaultProps = { + spacing: 20, + outRangeScale: 1, + autoInactive: true, +- onPress: () => {}, +- onPressIn: () => {}, +- onPressOn: () => {}, ++ onPress: () => { }, ++ onPressIn: () => { }, ++ onPressOn: () => { }, + backdrop: false, + degrees: 45, + position: "right",