mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-22 10:33:22 +00:00
Fix error during fake rendering
This commit is contained in:
@@ -65,11 +65,11 @@ function mapStateToProps(state, props) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
InjectedComponent: ReactRedux.connect(InjectedComponentSet, (state, props) => {
|
||||
InjectedComponent: ReactRedux.connect((state, props) => {
|
||||
const result = mapStateToProps(state, props);
|
||||
result.components = result.components.slice(0, 1);
|
||||
result.withContainer = false;
|
||||
return result;
|
||||
}),
|
||||
InjectedComponentSet: ReactRedux.connect(InjectedComponentSet, mapStateToProps)
|
||||
})(InjectedComponentSet),
|
||||
InjectedComponentSet: ReactRedux.connect(mapStateToProps)(InjectedComponentSet)
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@ const ReactRedux = require('react-redux');
|
||||
* @return {ReactComponent}
|
||||
*/
|
||||
function connect(Component, mapStateToProps) {
|
||||
return ReactRedux.connect(Component, mapStateToProps);
|
||||
return ReactRedux.connect(mapStateToProps)(Component);
|
||||
}
|
||||
|
||||
module.exports = connect;
|
||||
|
||||
@@ -13,7 +13,7 @@ const reducers = require('./reducers');
|
||||
*/
|
||||
function createStore(plugins, initialState) {
|
||||
const pluginReducers = plugins.map(plugin => plugin.onReduceState);
|
||||
const reducer = Redux.combine(reducers, ...pluginReducers);
|
||||
const reducer = Redux.compose(reducers, ...pluginReducers);
|
||||
|
||||
const store = Redux.createStore(
|
||||
reducer,
|
||||
|
||||
@@ -38,7 +38,8 @@ function render(initialState) {
|
||||
const innerHTML = ReactDOMServer.renderToString(el);
|
||||
const htmlEl = <HTML head={head} innerHTML={innerHTML} />;
|
||||
|
||||
return ReactDOMServer.renderToStaticMarkup(htmlEl);
|
||||
const html = ReactDOMServer.renderToStaticMarkup(htmlEl);
|
||||
return html;
|
||||
}
|
||||
|
||||
module.exports = render;
|
||||
|
||||
Reference in New Issue
Block a user