diff --git a/FabricExample/yarn.lock b/FabricExample/yarn.lock index e18c7b3a48..8a93f4a448 100644 --- a/FabricExample/yarn.lock +++ b/FabricExample/yarn.lock @@ -3828,13 +3828,6 @@ hermes-parser@0.24.0: dependencies: hermes-estree "0.24.0" -hoist-non-react-statics@^3.3.0: - version "3.3.2" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" - integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== - dependencies: - react-is "^16.7.0" - html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -5679,7 +5672,7 @@ react-devtools-core@^5.3.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== -react-is@^16.13.1, react-is@^16.7.0: +react-is@^16.13.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== diff --git a/MacOSExample/yarn.lock b/MacOSExample/yarn.lock index 287bc0af16..8908135b1a 100644 --- a/MacOSExample/yarn.lock +++ b/MacOSExample/yarn.lock @@ -4330,7 +4330,7 @@ hermes-profile-transformer@^0.0.6: dependencies: source-map "^0.7.3" -hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2: +hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== diff --git a/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt b/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt deleted file mode 100644 index b08ce9b584..0000000000 --- a/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.swmansion.gesturehandler.react - -import android.content.Context -import android.util.AttributeSet -import com.facebook.react.ReactRootView - -@Deprecated(message = "Use component instead. Check gesture handler installation instructions in documentation for more information.") -class RNGestureHandlerEnabledRootView : ReactRootView { - constructor(context: Context?) : super(context) - constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) - - init { - throw UnsupportedOperationException("Your application is configured to use RNGestureHandlerEnabledRootView which is no longer supported. You can see how to migrate to here: https://docs.swmansion.com/react-native-gesture-handler/docs/guides/migrating-off-rnghenabledroot") - } -} diff --git a/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt b/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt index 61c1b4c9a7..29b694f510 100644 --- a/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +++ b/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt @@ -59,14 +59,12 @@ class RNGestureHandlerRootView(context: Context?) : ReactViewGroup(context) { var parent = viewGroup.parent while (parent != null) { - // our own deprecated root view @Suppress("DEPRECATION") - if (parent is RNGestureHandlerEnabledRootView || parent is RNGestureHandlerRootView) { + if (parent is RNGestureHandlerRootView) { return true } // Checks other roots views but it's mainly for ReactModalHostView.DialogRootViewGroup // since modals are outside RN hierachy and we have to initialize GH's root view for it - // Note that RNGestureHandlerEnabledRootView implements RootView - that's why this check has to be below if (parent is RootView) { return false } diff --git a/example/yarn.lock b/example/yarn.lock index 6bba886a8f..275e0903d0 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -4927,7 +4927,7 @@ hermes-profile-transformer@^0.0.6: dependencies: source-map "^0.7.3" -hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2: +hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== diff --git a/package.json b/package.json index b845580cef..d30b3992dd 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "homepage": "https://github.com/software-mansion/react-native-gesture-handler#readme", "dependencies": { "@egjs/hammerjs": "^2.0.17", - "hoist-non-react-statics": "^3.3.0", "invariant": "^2.2.4" }, "devDependencies": { @@ -74,7 +73,6 @@ "@babel/preset-typescript": "^7.12.7", "@react-native/babel-preset": "^0.74.85", "@testing-library/react-native": "^12.5.1", - "@types/hoist-non-react-statics": "^3.3.1", "@types/invariant": "^2.2.37", "@types/jest": "^27.0.3", "@types/react": "^18.2.6", diff --git a/src/components/gestureHandlerRootHOC.tsx b/src/components/gestureHandlerRootHOC.tsx deleted file mode 100644 index 82a93138d0..0000000000 --- a/src/components/gestureHandlerRootHOC.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react'; -import { StyleSheet, StyleProp, ViewStyle } from 'react-native'; -import hoistNonReactStatics from 'hoist-non-react-statics'; -import GestureHandlerRootView from './GestureHandlerRootView'; - -export default function gestureHandlerRootHOC

( - Component: React.ComponentType

, - containerStyles?: StyleProp -): React.ComponentType

{ - function Wrapper(props: P) { - return ( - - - - ); - } - - Wrapper.displayName = `gestureHandlerRootHOC(${ - Component.displayName || Component.name - })`; - - // @ts-ignore - hoistNonReactStatics uses old version of @types/react - hoistNonReactStatics(Wrapper, Component); - - return Wrapper; -} - -const styles = StyleSheet.create({ - container: { flex: 1 }, -}); diff --git a/src/index.ts b/src/index.ts index d636ad1a7a..e030458cf7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,6 @@ import { initialize } from './init'; export { Directions } from './Directions'; export { State } from './State'; export { PointerType } from './PointerType'; -export { default as gestureHandlerRootHOC } from './components/gestureHandlerRootHOC'; export { default as GestureHandlerRootView } from './components/GestureHandlerRootView'; export type { // Event types diff --git a/yarn.lock b/yarn.lock index 7e90b3ff58..9be6c41893 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3714,14 +3714,6 @@ resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.41.tgz#f6ecf57d1b12d2befcce00e928a6a097c22980aa" integrity sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA== -"@types/hoist-non-react-statics@^3.3.1": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" - integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA== - dependencies: - "@types/react" "*" - hoist-non-react-statics "^3.3.0" - "@types/http-cache-semantics@*": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" @@ -6552,13 +6544,6 @@ hermes-profile-transformer@^0.0.6: dependencies: source-map "^0.7.3" -hoist-non-react-statics@^3.3.0: - version "3.3.2" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" - integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== - dependencies: - react-is "^16.7.0" - hosted-git-info@^2.1.4: version "2.8.9" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" @@ -9324,11 +9309,6 @@ react-devtools-core@^5.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react-is@^16.7.0: - version "16.13.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.0.tgz#0f37c3613c34fe6b37cd7f763a0d6293ab15c527" - integrity sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA== - react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"