简体   繁体   English

ReactJS + Redux:尽管安装了React-hot-loader为什么不起作用?

[英]ReactJS + Redux: Why doesn't react-hot-loader work although installed?

I have the following dependencies installed: 我安装了以下依赖项:

  "dependencies": {
    "express": "^4.13.4",
    "react": "^15.1.0",
    "react-dom": "^15.1.0",
    "react-redux": "^4.4.5",
    "react-router": "^2.4.1",
    "redux": "^3.5.2"
  },
  "devDependencies": {
    "babel-core": "^6.9.0",
    "babel-eslint": "^6.0.4",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-react-hmre": "^1.1.1",
    "babel-preset-stage-0": "^6.5.0",
    "eslint": "^2.11.1",
    "eslint-plugin-react": "^5.1.1",
    "react-hot-loader": "^1.3.0",
    "redux-logger": "^2.6.1",
    "redux-thunk": "^2.1.0",
    "webpack": "^1.13.1",
    "webpack-dev-middleware": "^1.6.1",
    "webpack-hot-middleware": "^2.10.0"
  }
}

The react-hot-loader used to work, where when I make a save to a change, it would reload automatically and update the application. react-hot-loader以前可以工作,当我保存更改时,它将自动重新加载并更新应用程序。 But not it does not work anymore, so I would have to refresh the whole application manually to update it. 但是,它不再起作用了,因此我将不得不手动刷新整个应用程序以进行更新。

What could be causing the issue? 是什么原因引起的? How could I go about fixing it? 我该如何解决呢? Not sure if this would be source of the problem, but I switch on and off between two different projects, one being React Native and another being ReactJS. 不知道这是否是问题的根源,但是我在两个不同的项目之间打开和关闭,一个是React Native,另一个是ReactJS。 But after getting into React Native, the react-hot-loader on ReactJS just stopped working. 但是进入React Native之后,ReactJS上的react-hot-loader刚刚停止工作。

Thank you in advance! 先感谢您!

react-native shouldn't affect the react-hot-loader in this project. react-native不应影响此项目中的react-hot-loader。

It's hard to tell without seeing any code as to get rhl to work the js needs to be created and rendered in the right way. 很难看到没有任何代码可以使rhl工作,需要以正确的方式创建和呈现js。

is this a server-side app or a client-side only app? 这是服务器端应用程序还是仅客户端应用程序? this has some bearing too. 这也有一些影响。

I have an example app, react-lego which shows how to add the latest version of react-hot-loader v3 我有一个示例应用程序react-lego ,其中显示了如何添加最新版本的react-hot-loader v3

hope it helps 希望能帮助到你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM