diff --git a/config/webpack/webpack.common.js b/config/webpack/webpack.common.js index bf37d9bb854f..a2e79d449c99 100644 --- a/config/webpack/webpack.common.js +++ b/config/webpack/webpack.common.js @@ -1,5 +1,5 @@ const path = require('path'); -const {IgnorePlugin, DefinePlugin} = require('webpack'); +const {IgnorePlugin} = require('webpack'); const {CleanWebpackPlugin} = require('clean-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyPlugin = require('copy-webpack-plugin'); @@ -42,10 +42,6 @@ const webpackConfig = { usePolyfillIO: platform === 'web', }), - // Configure the React Native Reanimated web support - // https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/web-support - new DefinePlugin({process: {env: {}}}), - // Copies favicons into the dist/ folder to use for unread status new CopyPlugin({ patterns: [ diff --git a/src/libs/Navigation/AppNavigator/DrawerNavigator/index.js b/src/libs/Navigation/AppNavigator/DrawerNavigator/index.js index e31a65d0c9df..94833b0eba27 100644 --- a/src/libs/Navigation/AppNavigator/DrawerNavigator/index.js +++ b/src/libs/Navigation/AppNavigator/DrawerNavigator/index.js @@ -8,7 +8,9 @@ const DrawerNavigator = props => ( // eslint-disable-next-line react/jsx-props-no-spreading {...props} - // Modern implementation of drawer does not work on mobile web + // Drawer's implementaion is buggy. Modern implementaion does not work on mobile web and legacy breaks the layout on Desktop while resizing. + // For some reason, drawer never closes when opening the Drawer screen on mobile web. + // So we will switch between implementations based on the device width. // eslint-disable-next-line react/jsx-props-no-multi-spaces useLegacyImplementation={props.isSmallScreenWidth} /> diff --git a/src/libs/Navigation/CustomActions.js b/src/libs/Navigation/CustomActions.js index 93737c9fbc07..7cb253f875d1 100644 --- a/src/libs/Navigation/CustomActions.js +++ b/src/libs/Navigation/CustomActions.js @@ -1,3 +1,4 @@ +import _ from 'underscore'; import {CommonActions, StackActions, DrawerActions} from '@react-navigation/native'; import lodashGet from 'lodash/get'; @@ -73,7 +74,7 @@ function pushDrawerRoute(screenName, params, navigationRef) { } const screenRoute = {type: 'route', name: screenName}; - const history = [...(state.history || [screenRoute])].map(() => screenRoute); + const history = _.map([...(state.history || [screenRoute])], () => screenRoute); // Force drawer to close and show the report screen history.push({