Home > Software design >  React Native Module not found: Can't resolve '@react-navigation/core' with react-nati
React Native Module not found: Can't resolve '@react-navigation/core' with react-nati

Time:11-15

I have this basic React Native Code which fails to compile as soon as I import anything from react-native-router-flux. It throws Module not found: Can't resolve '@react-navigation/core'

If I uncomment line import { Router, Scene } from "react-native-router-flux";, everything works fine. I also manually did npm install @react-navigation/core but to no avail

import React from "react";
import { Router, Scene } from "react-native-router-flux";

class Index extends React.Component {
    render() {
        return <div></div>
    }
}

export default Index;

What could I be missing?

Versions

React v17.0.2

react-native-router-flux v4.3.1

React-native v0.66.3

CodePudding user response:

The latest react-native version (v0.66.3) is incompatible with react-native-router-flux (v4.3.1) which is pretty old. Its better to look for @react-navigation/native

Thanks @XplosiVe06 for pointing out

  • Related