Add type to react-router context variable
This commit is contained in:
parent
85d5fd1110
commit
5f039f5f86
@ -4,6 +4,7 @@ import {IClientConfig} from './IClientConfig'
|
|||||||
import {IRenderer} from './IRenderer'
|
import {IRenderer} from './IRenderer'
|
||||||
import {IStoreFactory} from './IStoreFactory'
|
import {IStoreFactory} from './IStoreFactory'
|
||||||
import {Provider} from 'react-redux'
|
import {Provider} from 'react-redux'
|
||||||
|
import {StaticRouterContext} from 'react-router'
|
||||||
import {StaticRouter} from 'react-router-dom'
|
import {StaticRouter} from 'react-router-dom'
|
||||||
import {renderToNodeStream} from 'react-dom/server'
|
import {renderToNodeStream} from 'react-dom/server'
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ export class ServerRenderer<State, A extends Action> implements IRenderer {
|
|||||||
const {RootComponent} = this
|
const {RootComponent} = this
|
||||||
const store = this.createStore(state)
|
const store = this.createStore(state)
|
||||||
|
|
||||||
const context = {}
|
const context: StaticRouterContext = {}
|
||||||
const stream = renderToNodeStream(
|
const stream = renderToNodeStream(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<StaticRouter location={url} context={context} >
|
<StaticRouter location={url} context={context} >
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user