Created
September 18, 2015 17:29
-
-
Save marclar/4a9bd9cedf15d131013a to your computer and use it in GitHub Desktop.
When using aliases, server-side rendering won't work unless you explicitly pass the aliased methods to @connect => dispatch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as actions from 'redux/modules/content/page'; | |
import {page} from 'redux/modules/content'; | |
import {load as getPage} from 'redux/modules/content/page'; | |
@connect( | |
state => ({ | |
page: state.content.page.data, | |
error: state.content.page.error, | |
loading: state.content.page.loading | |
}), | |
dispatch => ({ | |
...bindActionCreators({ | |
...actions, | |
getPage //Required for SSR (otherwise, only the method names in `...actions` are available on the server) | |
}, dispatch) | |
}) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment