From 44556a03acccc6f3fa2386130a7739eb3232a711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Fri, 26 May 2023 15:47:58 +0200 Subject: [PATCH 1/2] migrate CurrencySymbolButton to PressableWithoutFeedback --- src/components/CurrencySymbolButton.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/CurrencySymbolButton.js b/src/components/CurrencySymbolButton.js index 8b73cabc1b23..b5929271031d 100644 --- a/src/components/CurrencySymbolButton.js +++ b/src/components/CurrencySymbolButton.js @@ -1,10 +1,10 @@ import React from 'react'; -import {TouchableOpacity} from 'react-native'; import PropTypes from 'prop-types'; import Text from './Text'; import styles from '../styles/styles'; import Tooltip from './Tooltip'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; +import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback'; const propTypes = { /** Currency symbol of selected currency */ @@ -19,9 +19,13 @@ const propTypes = { function CurrencySymbolButton(props) { return ( - + {props.currencySymbol} - + ); } From 6b4c0d2f2242d92948f7dd17cd879e5a198d18e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Mon, 29 May 2023 11:23:54 +0200 Subject: [PATCH 2/2] fixed console errors --- .../Pressable/PressableWithoutFeedback.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/Pressable/PressableWithoutFeedback.js b/src/components/Pressable/PressableWithoutFeedback.js index 5b25f207d2a3..92e704550dec 100644 --- a/src/components/Pressable/PressableWithoutFeedback.js +++ b/src/components/Pressable/PressableWithoutFeedback.js @@ -5,11 +5,16 @@ import GenericPressableProps from './GenericPressable/PropTypes'; const omittedProps = ['pressStyle', 'hoverStyle', 'focusStyle', 'activeStyle', 'disabledStyle', 'screenReaderActiveStyle', 'shouldUseHapticsOnPress', 'shouldUseHapticsOnLongPress']; -const PressableWithoutFeedback = (props) => { +const PressableWithoutFeedback = React.forwardRef((props, ref) => { const propsWithoutStyling = _.omit(props, omittedProps); - // eslint-disable-next-line react/jsx-props-no-spreading - return ; -}; + return ( + + ); +}); PressableWithoutFeedback.displayName = 'PressableWithoutFeedback'; PressableWithoutFeedback.propTypes = _.omit(GenericPressableProps.pressablePropTypes, omittedProps);