Add type to react-router context variable

This commit is contained in:
Jerko Steiner 2019-03-17 19:27:53 +05:00
parent 85d5fd1110
commit 5f039f5f86

View File

@ -4,6 +4,7 @@ import {IClientConfig} from './IClientConfig'
import {IRenderer} from './IRenderer'
import {IStoreFactory} from './IStoreFactory'
import {Provider} from 'react-redux'
import {StaticRouterContext} from 'react-router'
import {StaticRouter} from 'react-router-dom'
import {renderToNodeStream} from 'react-dom/server'
@ -16,7 +17,7 @@ export class ServerRenderer<State, A extends Action> implements IRenderer {
const {RootComponent} = this
const store = this.createStore(state)
const context = {}
const context: StaticRouterContext = {}
const stream = renderToNodeStream(
<Provider store={store}>
<StaticRouter location={url} context={context} >