Order of Higher Order Components (HOC) matters

I’ve just learned the hard way that order of calling Higher Order Components (HOC) matters and can lead to hard to debug errors. I’ve used the Redux and React Router Dom. Started with Redux so I had component like so:

import react, {Component} from 'react'
import connect from 'react-redux/lib/connect/connect';

class Home extends Component {
    // ... chopped for brevity
}

export default connect(mapStateToProps)(Home);

Continue reading