TypeError: null is not an object (evaluating '_ReanimatedModule.default.createNode')

TypeError: null is not an object (evaluating '_ReanimatedModule.default.createNode')

我无法解决这个问题,并查看了以下文档 https://www.npmjs.com/package/react-native-tab-view

我也没有遇到任何关于这个问题的文件。我使用了上面提到的相同示例代码 link.

import * as React from 'react';
import { View, StyleSheet, Dimensions } from 'react-native';
import { TabView, SceneMap } from 'react-native-tab-view';
 
const FirstRoute = () => (
  <View style={[styles.scene, { backgroundColor: '#ff4081' }]} />
);
 
const SecondRoute = () => (
  <View style={[styles.scene, { backgroundColor: '#673ab7' }]} />
);
 
const initialLayout = { width: Dimensions.get('window').width };
 
export default function TabViewExample() {
  const [index, setIndex] = React.useState(0);
  const [routes] = React.useState([
    { key: 'first', title: 'First' },
    { key: 'second', title: 'Second' },
  ]);
 
  const renderScene = SceneMap({
    first: FirstRoute,
    second: SecondRoute,
  });
 
  return (
    <TabView
      navigationState={{ index, routes }}
      renderScene={renderScene}
      onIndexChange={setIndex}
      initialLayout={initialLayout}
    />
  );
}
 
const styles = StyleSheet.create({
  scene: {
    flex: 1,
  },
});

我该如何解决?

npm version is 6.14.4
React-native version is 0.62.2
react-native-tab-view: "^2.15.0"
react-native-gesture-handler: "^1.6.1"
react-native-reanimated: "^1.10.1"
@react-native-community/masked-view: "^0.1.10"

使用react-native link react-native-reanimated 然后按照这个 link https://github.com/software-mansion/react-native-reanimated/blob/master/Example/android/app/src/main/java/com/swmansion/reanimated/example/MainApplication.java

将 react-native-gesture-handler 升级到 1.7.0

运行npm i react-native-gesture-handler@1.7.0。清除缓存并重新构建。

从 0.59 版本开始不需要链接,因为它会自动链接依赖项。