mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-25 22:37:18 +10:00
Fix configureStore params
This commit is contained in:
parent
d0b728bfd6
commit
3a1ed66c5e
3 changed files with 5 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ exports.loadData = function(requestUrl, sdk) {
|
|||
const { pathname, query } = url.parse(requestUrl);
|
||||
const matchedRoutes = matchPathname(pathname, routeConfiguration());
|
||||
|
||||
const store = configureStore(sdk);
|
||||
const store = configureStore({}, sdk);
|
||||
|
||||
const dataLoadingCalls = matchedRoutes.reduce((calls, match) => {
|
||||
const { route, params } = match;
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ ServerApp.propTypes = { url: string.isRequired, context: any.isRequired, store:
|
|||
* - {Object} head: Application head metadata from react-helmet
|
||||
*/
|
||||
export const renderApp = (url, serverContext, preloadedState) => {
|
||||
// Pass `null` as the SDK instance since we're only rendering the
|
||||
// Don't pass an SDK instance since we're only rendering the
|
||||
// component tree with the preloaded store state and components
|
||||
// shouldn't do any SDK calls in the (server) rendering lifecycle.
|
||||
const store = configureStore(null, preloadedState);
|
||||
const store = configureStore(preloadedState);
|
||||
|
||||
const body = ReactDOMServer.renderToString(
|
||||
<ServerApp url={url} context={serverContext} store={store} />
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { ClientApp, ServerApp } from './app';
|
|||
import configureStore from './store';
|
||||
|
||||
const render = (url, context) => {
|
||||
const store = configureStore({});
|
||||
const store = configureStore();
|
||||
const body = ReactDOMServer.renderToString(
|
||||
<ServerApp url={url} context={context} store={store} />
|
||||
);
|
||||
|
|
@ -18,7 +18,7 @@ const render = (url, context) => {
|
|||
describe('Application', () => {
|
||||
it('renders in the client without crashing', () => {
|
||||
window.google = { maps: {} };
|
||||
const store = configureStore({});
|
||||
const store = configureStore();
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(<ClientApp store={store} />, div);
|
||||
delete window.google;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue