无法解析模块“react-redux”...模块“react-redux”在 Haste 模块映射中不存在

Sar*_*nya 5 module react-native react-redux

app.js 文件中包含用于 React Redux 的导入语句的代码被创建,以显示带有名为“Tech stack”的文本的标题。

App.js

import React from 'react';
import { View } from 'react-native';
import { Header } from './components/common';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import reducers from './reducers';


const App = () => {
  return(
    <Provider store={createStore(reducers)}>
      <View>
        <Header headerText="Tech Stack" />
      </View>
    </Provider>
  );
};

export default App;

This is the index file

index.js

import { AppRegistry } from 'react-native';
import App from './src/App';


AppRegistry.registerComponent(tech_stack, () => App);
Run Code Online (Sandbox Code Playgroud)

在终端上运行它时,它会抛出一个错误,指出无法解析模块“react-redux”。

Nab*_*l K 3

关闭 JS 包(第一次运行应用程序时会启动终端)并使用react-native start项目路径中的命令重新运行它。基本上,您需要在每个包安装后重新运行 JS 包。