Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
RootRoutes.prototype.renderApp = function () {
if (Store.User.isLogin) {
console.log("-----------路由列表-----------", lodash.find(this.routes, function (x) { return x.path == "/"; }).routes);
return React.createElement(LocaleProvider, { locale: zhCN },
React.createElement(React.Fragment, null, renderRoutes(this.routes)));
}
return React.createElement(Login, null);
};
RootRoutes.prototype.render = function () {
public render() {
const { url } = (this.props as any).data;
console.log('url: ', url);
const routeConfig = convertCustomRouteConfig(routes);
console.log('routeConfig: ', routeConfig);
return (
{
renderRoutes(routeConfig)
}
);
}
}
render() {
return (
<header>
{renderRoutes(this.props.route.routes)}
)
}
}</header>
export const App = () => (
<div>
<header>
<main>
{renderRoutes(routes)}
</main>
<footer>
</footer></header></div>
);
export async function renderTree (props) {
const app = (
{renderRoutes(props.tree)}
)
return {
rendered: renderToString(app),
helmet: helmet.renderStatic(),
}
}
render() {
const {
route: { routes },
} = this.props;
return renderRoutes(routes);
}
}
render() {
return renderRoutes(applicationRoutes);
}
}
export function Layout(props) {
return (
<div>
<nav>
<div>
<h3>Isomorphic React / Relay Modern / React Router App</h3>
<div>{renderRoutes(props.route.routes, props)}</div>
</div>
</nav></div>
)
}
import createStore from '../helpers/createStore';
const axiosInstance = axios.create({
baseURL: '/api',
});
const store = createStore(
axiosInstance,
window.INITIAL_STATE,
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,
);
export const client = (
<div>{renderRoutes(Routes)}</div>
);
ReactDOM.hydrate(
client,
document.querySelector('#root'),
);
.then(() => {
renderMethod = renderMethod || renderToString;
const content = renderMethod(
{renderRoutes(routes)}
);
if (context.url) {
res.redirect(301, context.url);
} else {
const helmet = Helmet.renderStatic();
const page = renderToString(
);