React-redux: Uncaught TypeError: Cannot read property 'displayName' of undefined

Created on 22 May 2016  路  2Comments  路  Source: reduxjs/react-redux

disregard

Most helpful comment

For future reference for people who come here, this is possibly related to imports being malformed.

In my specific case, it was the import {x as y} syntax that Babel 6 wasn't liking.

All 2 comments

For future reference for people who come here, this is possibly related to imports being malformed.

In my specific case, it was the import {x as y} syntax that Babel 6 wasn't liking.

I got this error because I accidentally added parentheses after my class decorator:

@withRouter() // Don't write parentheses here!
@connect(null, { loginUser })
class Login extends React.Component { ... }

The way to write it is just @withRouter.

Was this page helpful?
0 / 5 - 0 ratings