UNPKG

infrastructure-components

Version:

Infrastructure-Components configure the infrastructure of your React-App as part of your React-Components.

16 lines 849 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = __importDefault(require("react")); const react_router_dom_1 = require("react-router-dom"); const RedirectWithStatus = ({ key, from, to, status }) => (react_1.default.createElement(react_router_dom_1.Route, { render: ({ staticContext }) => { // there is no `staticContext` on the client, so // we need to guard against that here if (staticContext) staticContext.status = status; return react_1.default.createElement(react_router_dom_1.Redirect, { key: key, from: from, to: to }); } })); exports.default = RedirectWithStatus; //# sourceMappingURL=redirect-w-status.js.map