Skip to content

Conversation

@aweary
Copy link

@aweary aweary commented Jul 15, 2016

Currently, if you fail to pass a component to the function returned by connect it fails in a confusing way (usually inst.render is not a function) that can be hard to track down if you're new to Redux.

This PR adds a check, making sure a function is passed to connect, throwing a useful error if not.


return function wrapWithConnect(WrappedComponent) {
invariant(
typeof WrappedComponent == 'function',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: ===?

foiseworth pushed a commit to foiseworth/react-redux that referenced this pull request Jul 30, 2016
@timdorr
Copy link
Member

timdorr commented Aug 14, 2016

Superseded by #416

@timdorr timdorr closed this Aug 14, 2016
aikoven pushed a commit to aikoven/react-redux that referenced this pull request Nov 21, 2016
neeharv pushed a commit to neeharv/react-redux that referenced this pull request Feb 18, 2017
albertodev7 pushed a commit to albertodev7/react-redux that referenced this pull request Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants