未找到 React Native 模块:无法使用 react-native-router-flux 解析 '@react-navigation/core'
React Native Module not found: Can't resolve '@react-navigation/core' with react-native-router-flux
我有这个基本的 React Native 代码,一旦我从 react-native-router-flux
导入任何东西,它就无法编译。它抛出 Module not found: Can't resolve '@react-navigation/core'
如果我取消注释行 import { Router, Scene } from "react-native-router-flux";
,一切正常。我也手动做了 npm install @react-navigation/core
但没有用
import React from "react";
import { Router, Scene } from "react-native-router-flux";
class Index extends React.Component {
render() {
return <div></div>
}
}
export default Index;
我可能遗漏了什么?
版本
React v17.0.2
react-native-router-flux v4.3.1
React-native v0.66.3
最新的 react-native 版本 (v0.66.3) 与相当旧的 react-native-router-flux (v4.3.1) 不兼容。最好找@react-navigation/native
感谢@XplosiVe06 指出
我有这个基本的 React Native 代码,一旦我从 react-native-router-flux
导入任何东西,它就无法编译。它抛出 Module not found: Can't resolve '@react-navigation/core'
如果我取消注释行 import { Router, Scene } from "react-native-router-flux";
,一切正常。我也手动做了 npm install @react-navigation/core
但没有用
import React from "react";
import { Router, Scene } from "react-native-router-flux";
class Index extends React.Component {
render() {
return <div></div>
}
}
export default Index;
我可能遗漏了什么?
版本
React v17.0.2
react-native-router-flux v4.3.1
React-native v0.66.3
最新的 react-native 版本 (v0.66.3) 与相当旧的 react-native-router-flux (v4.3.1) 不兼容。最好找@react-navigation/native
感谢@XplosiVe06 指出