-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't pass on Context when using with react-redux's connect #436
Comments
@MQuy can you try defining a wrapper = shallow(<TestPage>, {
context: {
store: mockStore
},
childContextTypes: {
store: React.PropTypes.Object
} |
@aweary I tried, it's still the same, just tested in this repo https://github.com/MQuy/redux-store-enzyme |
@MQuy this is exactly what we do internally where I work, so I'll have to try and reproduce when I'm back home to see what's going on 👍 |
thank @aweary 👍 |
Does rewiring
But this isn't working for me. Am I missing something? |
closing in favor of #472 |
There's an npm module that makes it really easy to add redux to the react context https://github.com/jamrizzi/redux-context-provider import React, { Component } from 'react';
import ReduxContextProvider from 'redux-context-provider';
import createStore from './createStore';
import actions from './actions';
import Routes from './routes';
export default class App extends Component {
render() {
return (
<ReduxContextProvider store={store} actions={actions}>
<Routes />
</ReduxContextProvider>
);
}
} |
Hi Guys,
I've a bit of a situation, when using enzyme for rendering React Components for my unit tests, I cannot pass over the context when I am exporting the component using react-redux's
connect
.Let me show you what I mean:
Component:
Test:
This WORKS!
BUT:
Component:
Test:
Spits out:
Warning: Failed Context Types: Required context
awas not specified in
TestPage``Help... How do I pass on my context through Redux's connect function?
The text was updated successfully, but these errors were encountered: