You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure that component prop 'context' really contains a React context … (#1134)
* Ensure that component prop 'context' really contains a React context before using it
after switching to react-redux 6.0.0, we've had a lot of errors stating
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
all over in our app. After digging deeper, we've discovered that we use a lot of (connected) components using a property named 'context' which conflicts with your new connectAdvanced code. So maybe you can improve the check on this.props.context a little bit to ensure it is used only if it really contains a valid React context.
* Update connectAdvanced.js
* Update connectAdvanced.js
* improved check whether context given as a prop is a real ReactContext
* added test for ignoring non-react-context values passed as a prop to the component
* Use react-is checks
* Just check Consumer. Good enough!
* improved check for context.Consumer
* added missing export 'isContextConsumer' in rollup config
0 commit comments