Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as Routing from 'react-router-dom';
export default Routing;
const userAgent = navigator.userAgent.toLowerCase();
let route = null;
if (userAgent.indexOf(' electron/') > -1) {
// Electron hash router
route = Routing.HashRouter;
} else {
route = Routing.BrowserRouter
}
export const Router = route;
var normal_1 = require("./normal");
var object_1 = require("./object");
var custom_hoc_1 = require("./custom.hoc");
var antd_1 = require("antd");
var store = redux_1.createStore(redux_immutable_1.combineReducers({
"arraySetting": array_1.settings.reducer,
"array": array_1.reducer.reducer,
"normal": normal_1.reducer.reducer,
"object": object_1.reducer.reducer,
"custom.hoc": custom_hoc_1.reducer.reducer
}), immutable.Map());
store.subscribe(function () {
console.log(store.getState().toJS().object);
});
react_dom_1.default.render(react_1.default.createElement(react_redux_1.Provider, { store: store },
react_1.default.createElement(react_router_dom_1.HashRouter, null,
react_1.default.createElement("div", null,
react_1.default.createElement("div", { style: { display: "none" } },
react_1.default.createElement(react_perf_tool_1.default, { perf: react_addons_perf_1.default })),
react_1.default.createElement(antd_1.Menu, { mode: "horizontal", theme: "dark" },
react_1.default.createElement(antd_1.Menu.Item, { key: "home" },
react_1.default.createElement(react_router_dom_1.Link, { to: "/" },
react_1.default.createElement(antd_1.Icon, { type: "mail" }),
"\u4E3B\u9875")),
react_1.default.createElement(antd_1.Menu.Item, { key: "array" },
react_1.default.createElement(react_router_dom_1.Link, { to: "/array" },
react_1.default.createElement(antd_1.Icon, { type: "mail" }),
"\u65E0\u9650\u6781\u6570\u7EC4")),
react_1.default.createElement(antd_1.Menu.Item, { key: "object" },
react_1.default.createElement(react_router_dom_1.Link, { to: "/object" },
react_1.default.createElement(antd_1.Icon, { type: "mail" }),
"\u5BF9\u8C61\u7C7B\u578B")),
to: "/apps"
}, "Application List")), React.createElement(_reactRouterDom.Switch, null, React.createElement(_reactRouterDom.Route, {
path: "/apps",
component: Apps
}), React.createElement(_reactRouterDom.Route, {
render: function render() {
return React.createElement("span", null, "Home Page");
}
})), React.createElement(_antd.Alert, {
style: {
margin: '16px 0'
},
message: "Click the navigation above to switch:"
}), React.createElement(_antd.Breadcrumb, null, breadcrumbItems));
});
return React.createElement(_reactRouterDom.HashRouter, null, React.createElement(Home, null));
}
exports.App = () => (React.createElement(react_router_dom_1.HashRouter, { key: "browser-router", hashType: "noslash", basename: "/" },
React.createElement("div", { style: { display: 'flex' } },
React.createElement(react_router_dom_1.Link, { to: "/" }, "home"),
"\u00A0",
React.createElement(react_router_dom_1.Link, { to: "/second" }, "second"),
"\u00A0",
React.createElement(react_router_dom_1.Link, { to: "/third" }, "third"),
"\u00A0",
React.createElement(react_router_dom_1.Link, { to: "/toggler" }, "toggler"),
"\u00A0",
React.createElement(react_router_dom_1.Link, { to: "/sidebar" }, "sidebar")),
React.createElement(react_router_dom_1.Route, { render: ({ location }) => (React.createElement(framer_motion_1.AnimatePresence, { exitBeforeEnter: true, initial: false },
React.createElement(react_router_dom_1.Switch, null,
React.createElement(react_router_dom_1.Route, { exact: true, path: '/', component: FirstPage }),
React.createElement(react_router_dom_1.Route, { exact: true, path: '/second', component: SecondPage }),
React.createElement(react_router_dom_1.Route, { exact: true, path: '/third', component: ThirdPage }),
React.createElement(react_router_dom_1.Route, { exact: true, path: '/toggler', component: ToggleVisibility }),
'use strict';
var React = require('react');
var ReactDOM = require('react-dom');
var RouterDOM = require('react-router-dom');
var Router = RouterDOM.HashRouter;
var routes = require('./routes.jsx');
var Overlays = require('./overlays.jsx');
ReactDOM.render(
<div id="main">
{routes}
</div>,
document.getElementById('app'));
if (this.props.route && !this.props.redirect) {
return this.renderStatic();
}
if (!this.routes || this.routes.length === 0) {
return _react2.default.createElement('div', null);
}
if (this.props.autoRefresh) {
this._refreshRoutes(this.state.account);
}
if (this.props.desktop) {
return _react2.default.createElement(
_reactRouterDom.HashRouter,
null,
_react2.default.createElement(
_reactRouter.Switch,
null,
this.renderRoutes()
)
);
}
return _react2.default.createElement(
_reactRouterDom.BrowserRouter,
null,
_react2.default.createElement(
_reactRouter.Switch,
{ style: {} },
this.renderRoutes(),
var App = function App() {
return _react2.default.createElement(
'main',
null,
_react2.default.createElement(
_reactRouterDom.HashRouter,
null,
_react2.default.createElement(
_react2.default.Fragment,
null,
_react2.default.createElement(_reactRouterDom.Route, { path: '/cli', component: _CLIPage2.default }),
_react2.default.createElement(_reactRouterDom.Route, { path: '/demo', component: _Demo2.default }),
_react2.default.createElement(_reactRouterDom.Route, { exact: true, path: '/', component: _Home2.default })
)
)
);
};