Closed
Description
Do we expect dispatching in componentWillMount
to take effect before the component is rendered?
For example, this test fails:
it('should handle dispatches before componentDidMount', () => {
const store = createStore(stringBuilder)
@connect(state => ({ string: state }) )
class Container extends Component {
componentWillMount() {
store.dispatch({ type: 'APPEND', body: 'a' })
}
render() {
expect(this.props.string).toBe('a'); // => Error: Expected '' to be 'a'
return <Passthrough {...this.props}/>
}
}
const tree = TestUtils.renderIntoDocument(
<ProviderMock store={store}>
<Container />
</ProviderMock>
)
})
Metadata
Metadata
Assignees
Labels
No labels