gaearon / gaearon/react-hot-loader

Infinite render loop in 4.12.1 and up.

Open
#1,294 21 comments 11 reactions 1 assignee Claimed by @theKashey View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
775
PR merge metrics
No merged PRs in 30d

Description

### Description

For versions 4.12.1 and up (last tested at 4.12.5), my app goes into a infinite render loop, resulting in "Invariant: Maximum update depth exceeded" error displaying in the rhl redbox anytime it hot reloads, or on pages that makes change to redux state. It works fine in 4.12.0.

The error is the result of one of the root components of my app, exported with `react-redux connect`:
```js
export default connect(mapStateToProps, undefined, undefined, {pure: false})(MyComponent)
```
If I change the `pure` option to true, the problem disappears.
```js
export default connect(mapStateToProps, undefined, undefined, {pure: true})(MyComponent)
```

Don't have time right now to create a reproducible demo, I'll look into it if its needed.

### Expected behavior

It's shouldn't break.

### Actual behavior

It goes into an infinite render loop.

### Environment

React Hot Loader version: 4.12.1 and up

Run these commands in the project folder and fill in their results:

1. `node -v`: v11.9.0
2. `npm -v`: 6.5.0

Then, specify:

1. Operating system: MacOS Mojave
2. Browser and version: Chrome/Firefox latest

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.