1 | import React from 'react';
|
2 | import { Route, Redirect } from 'react-router-dom';
|
3 |
|
4 | const RedirectWithStatus = ({ key, from, to, status }) => (
|
5 | <Route render={({ staticContext }) => {
|
6 | // there is no `staticContext` on the client, so
|
7 | // we need to guard against that here
|
8 | if (staticContext)
|
9 | staticContext.status = status
|
10 | return <Redirect key={key} from={from} to={to} />
|
11 | }} />
|
12 | )
|
13 | export default RedirectWithStatus; |
\ | No newline at end of file |