react-redux-blog icon indicating copy to clipboard operation
react-redux-blog copied to clipboard

Router.js:130 Uncaught TypeError: _this.setState is not a function

Open holyboom opened this issue 8 years ago • 0 comments

For those who have this issue. it seems that react-router uses create-react-class, which will need to be aliased to the preact-compat version with webpack, browserify or babel, e.g:

// webpack.config.js
module.exports = {
// ...
    alias: {
        'react': 'preact-compat',
        'react-dom': 'preact-compat',
        'create-react-class': 'preact-compat/lib/create-react-class'
    }
}

holyboom avatar Oct 04 '17 16:10 holyboom