The <StaticRouter> component accepts props basename, location, and context. Similar to other Router implementations, the basename prop in <StaticRouter> is used to specify the baseURL location and the location, prop is used to specify the location properties—pathname, hash, search, and state.
The context prop is used only in the <StaticRouter> implementation, and it contains the result of the component render. As mentioned previously, the context object can be populated with an HTTP status code and with other arbitrary properties as well.
At the time of initialization, the context object can contain properties that can then be consumed by the rendered component:
const context = {
message: 'From StaticRouter\'s context object'
}
const reactMarkup = ReactDOMServer.renderToString(
<StaticRouter context={context...