mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
In ReactReduxSpa, configure store before matching routes. Fixes #663
This commit is contained in:
@@ -10,6 +10,7 @@ import configureStore from './configureStore';
|
|||||||
export default createServerRenderer(params => {
|
export default createServerRenderer(params => {
|
||||||
return new Promise<RenderResult>((resolve, reject) => {
|
return new Promise<RenderResult>((resolve, reject) => {
|
||||||
// Match the incoming request against the list of client-side routes
|
// Match the incoming request against the list of client-side routes
|
||||||
|
const store = configureStore();
|
||||||
match({ routes, location: params.location }, (error, redirectLocation, renderProps: any) => {
|
match({ routes, location: params.location }, (error, redirectLocation, renderProps: any) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
throw error;
|
throw error;
|
||||||
@@ -27,7 +28,6 @@ export default createServerRenderer(params => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build an instance of the application
|
// Build an instance of the application
|
||||||
const store = configureStore();
|
|
||||||
const app = (
|
const app = (
|
||||||
<Provider store={ store }>
|
<Provider store={ store }>
|
||||||
<RouterContext {...renderProps} />
|
<RouterContext {...renderProps} />
|
||||||
|
|||||||
Reference in New Issue
Block a user