gpt4 book ai didi

javascript - TypeError : e. _panGestureHandler.current.setNativeProps 不是函数

转载 作者:行者123 更新时间:2023-11-30 14:11:23 24 4
gpt4 key购买 nike

我有以下Snack Expo:

https://snack.expo.io/rJ4mAxhmV

然后,我尝试将 react-navigation 的版本更新为 3.0.9,结果如下:

https://snack.expo.io/rkPpag2mV

以下是我对初始项目应用的唯一更改:

enter image description here

下面的文本模式:

diff --git a/App.js b/App.js
index 7f4eaf7..09ff71d 100644
--- a/App.js
+++ b/App.js
@@ -10,7 +10,7 @@ import {
type Theme,
} from 'react-native-paper';
import createReactContext from 'create-react-context';
-import { createDrawerNavigator } from 'react-navigation';
+import { createDrawerNavigator, createAppContainer } from 'react-navigation';
import RootNavigator from './src/RootNavigator';
import DrawerItems from './DrawerItems';

@@ -21,7 +21,7 @@ type State = {

const PreferencesContext: any = createReactContext();

-const App = createDrawerNavigator(
+const DrawerNavigator = createDrawerNavigator(
{ Home: { screen: RootNavigator } },
{
contentComponent: () => (
@@ -42,6 +42,8 @@ const App = createDrawerNavigator(
}
);

+const App = createAppContainer(DrawerNavigator);
+
export default class PaperExample extends React.Component<{}, State> {
state = {
theme: DefaultTheme,
diff --git a/package.json b/package.json
index 4e6d18a..eb2aec0 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,6 @@
"prop-types": "^15.0.0",
"react-lifecycles-compat": "^3.0.4",
"react-native-paper": "2.4.0",
- "react-navigation": "^2.18.2"
+ "react-navigation": "^3.0.9"
}
}
\ No newline at end of file

我的问题是,当单击列表中的任何条目时,出现错误:

Device: (3:209750) TypeError: TypeError: e._panGestureHandler.current.setNativeProps is not a function. (In 'e._panGestureHandler.current.setNativeProps({hitSlop:s,activeOffsetX:u*o})', 'e._panGestureHandler.current.setNativeProps' is undefined)

如你所见:

enter image description here

知道如何解决这个问题吗?

如果可能,请提供修复了 Snack Expo 的链接。

谢谢!

最佳答案

^3.0.9 与 3.1.0 匹配,这取决于更新版本的 react-native-gesture-handler 仅在 SDK32 或更高版本中可用。我建议将版本从“^3.0.9”更改为“3.0.9”或更改为 SDK32。

这是一个有效的小吃:https://snack.expo.io/@react-navigation/react-native-paper

关于javascript - TypeError : e. _panGestureHandler.current.setNativeProps 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54395434/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com