Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
enhanceElement(element) {
const props = {
...this.options.router,
basename: trimTrailingSlash(ensureLeadingSlash(this.config.basePath)),
};
return createElement(BrowserRouter, props, element);
}
render() {
enhanceElement(element) {
const { pathname, search } = this.url;
const props = {
...this.options.router,
location: { pathname, search },
basename: trimTrailingSlash(ensureLeadingSlash(this.config.basePath)),
context: this.context,
};
return createElement(StaticRouter, props, element);
}
renderToFragments(element) {
return locations.map((location) => {
const isString = typeof location === 'string';
const url = ensureLeadingSlash(
joinUrl(basePath, isString ? location : location.url)
);
return isString ? { url } : { ...location, url };
});
}