Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am unable to resolve this, and gone through the below document https://www.npmjs.com/package/react-native-tab-view

enter image description here

Also I did not come across any document regarding this issue. I have used the same sample code mentioned in the above 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,
  },
});

How do I resolve this?

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"
like image 302
Prajna Avatar asked Jul 31 '20 10:07

Prajna


2 Answers

run npm i [email protected]. Clear cache and build again.

Linking is not required from version 0.59 as it auto links the dependencies.

like image 159
Jopsy Avatar answered Sep 28 '22 00:09

Jopsy


Upgrade the react-native-gesture-handler to 1.7.0

like image 45
Prajna Avatar answered Sep 28 '22 02:09

Prajna