From 48aaf981d8918faf0ec3a3f1d1f24ae86e0b5748 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Tue, 13 Jun 2023 17:09:50 +0200 Subject: [PATCH] feat: remove v4 from repo (#1790) PR removing createNativeStackNavigator.tsx file from the repo along with all the code regarding it. It may be considered BREAKING CHANGE for people still using react-navigation v4 in their app and should not update the version of react-native-screens if they still want to use that deprecated version. --- .eslintrc.js | 1 - Example/App.tsx | 7 - Example/metro.config.js | 2 - Example/package.json | 4 +- Example/src/screens/StackReactNavigation4.tsx | 100 --- Example/yarn.lock | 60 +- FabricExample/metro.config.js | 2 - FabricTestExample/metro.config.js | 2 - README.md | 1 - TVOSExample/metro.config.js | 2 - TVOSExample/package.json | 6 +- TVOSExample/yarn.lock | 85 +-- TestsExample/metro.config.js | 2 - createNativeStackNavigator/README.md | 522 --------------- createNativeStackNavigator/package.json | 6 - package.json | 7 +- patches/react-navigation-stack+2.10.4.patch | 80 --- src/createNativeStackNavigator.tsx | 595 ------------------ tsconfig.json | 1 - yarn.lock | 124 +--- 20 files changed, 11 insertions(+), 1598 deletions(-) delete mode 100644 Example/src/screens/StackReactNavigation4.tsx delete mode 100644 createNativeStackNavigator/README.md delete mode 100644 createNativeStackNavigator/package.json delete mode 100644 patches/react-navigation-stack+2.10.4.patch delete mode 100644 src/createNativeStackNavigator.tsx diff --git a/.eslintrc.js b/.eslintrc.js index eac27f74eb..f08d477670 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,7 +19,6 @@ module.exports = { 'import/core-modules': [ 'react-native-screens', 'react-native-screens/native-stack', - 'react-native-screens/createNativeStackNavigator', 'react-native-screens/reanimated', ], 'import/ignore': [ diff --git a/Example/App.tsx b/Example/App.tsx index 575b45a313..3af0e5e483 100644 --- a/Example/App.tsx +++ b/Example/App.tsx @@ -20,7 +20,6 @@ import HeaderOptions from './src/screens/HeaderOptions'; import StatusBarExample from './src/screens/StatusBar'; import Animations from './src/screens/Animations'; import BottomTabsAndStack from './src/screens/BottomTabsAndStack'; -import StackReactNavigation4 from './src/screens/StackReactNavigation4'; import Modals from './src/screens/Modals'; import Orientation from './src/screens/Orientation'; import SearchBar from './src/screens/SearchBar'; @@ -63,12 +62,6 @@ const SCREENS: Record< component: Modals, type: 'example', }, - StackReactNavigation4: { - title: 'Stack react-navigation v4', - // @ts-ignore react-navigation v4 AppNavigator type - component: StackReactNavigation4, - type: 'example', - }, HeaderOptions: { title: 'Header Options', component: HeaderOptions, diff --git a/Example/metro.config.js b/Example/metro.config.js index 7c5ea31236..b2275182f6 100644 --- a/Example/metro.config.js +++ b/Example/metro.config.js @@ -9,8 +9,6 @@ const root = path.resolve(__dirname, '..'); const modules = [ '@react-navigation/native', - 'react-navigation', - 'react-navigation-stack', 'react-native-safe-area-context', ...Object.keys(pack.peerDependencies), ]; diff --git a/Example/package.json b/Example/package.json index f6cd04982d..d64a3618f7 100644 --- a/Example/package.json +++ b/Example/package.json @@ -30,9 +30,7 @@ "react-native-safe-area-context": "^4.4.1", "react-native-screens": "link:../", "react-native-vector-icons": "^8.0.0", - "react-native-webview": "^11.13.0", - "react-navigation": "^4.4.4", - "react-navigation-stack": "^2.10.3" + "react-native-webview": "^11.13.0" }, "devDependencies": { "@babel/core": "^7.12.16", diff --git a/Example/src/screens/StackReactNavigation4.tsx b/Example/src/screens/StackReactNavigation4.tsx deleted file mode 100644 index 2c5b541c97..0000000000 --- a/Example/src/screens/StackReactNavigation4.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import React from 'react'; -import { View, Text, StyleSheet, I18nManager } from 'react-native'; -import { NavigationStackProp } from 'react-navigation-stack'; -import { createCompatNavigatorFactory } from '@react-navigation/compat'; - -// in this example we use compatibility layer to show v4 syntax within v5 project -// but normally with v4 you would use different import -// import createNativeStackNavigator from 'react-native-screens/createNativeStackNavigator'; -import { createNativeStackNavigator } from 'react-native-screens/native-stack'; -// more information about compatibility layer https://reactnavigation.org/docs/compatibility/ - -import { Button } from '../shared'; - -class HomeScreen extends React.Component<{ navigation: NavigationStackProp }> { - render() { - return ( - - Home Screen -