From b24474d860b3f09499c7a3a6312b66e43e7abc5f Mon Sep 17 00:00:00 2001 From: Tienifr <113963320+tienifr@users.noreply.github.com> Date: Wed, 18 Oct 2023 03:52:41 +0000 Subject: [PATCH 1/3] Revert "Remove 'withNavigationFallback.js' HOC" --- .eslintrc.js | 2 +- src/components/Button/index.js | 7 +++- src/components/withNavigationFallback.js | 43 ++++++++++++++++++++++++ src/libs/getComponentDisplayName.ts | 2 +- src/stories/Composer.stories.js | 29 ++++++++-------- 5 files changed, 65 insertions(+), 18 deletions(-) create mode 100644 src/components/withNavigationFallback.js diff --git a/.eslintrc.js b/.eslintrc.js index 83e9479ce0c4..75a74ed371c4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -116,7 +116,7 @@ module.exports = { }, { selector: ['parameter', 'method'], - format: ['camelCase', 'PascalCase'], + format: ['camelCase'], }, ], '@typescript-eslint/ban-types': [ diff --git a/src/components/Button/index.js b/src/components/Button/index.js index 16654ce87d30..dc12a4ded5c2 100644 --- a/src/components/Button/index.js +++ b/src/components/Button/index.js @@ -9,6 +9,8 @@ import Icon from '../Icon'; import CONST from '../../CONST'; import * as StyleUtils from '../../styles/StyleUtils'; import HapticFeedback from '../../libs/HapticFeedback'; +import withNavigationFallback from '../withNavigationFallback'; +import compose from '../../libs/compose'; import * as Expensicons from '../Icon/Expensicons'; import withNavigationFocus from '../withNavigationFocus'; import validateSubmitShortcut from './validateSubmitShortcut'; @@ -326,7 +328,10 @@ class Button extends Component { Button.propTypes = propTypes; Button.defaultProps = defaultProps; -export default withNavigationFocus( +export default compose( + withNavigationFallback, + withNavigationFocus, +)( React.forwardRef((props, ref) => (