This commit is contained in:
sebastienlorber 2022-08-25 13:28:57 +02:00
parent 31591a3877
commit 98957bbeaf

View File

@ -18,7 +18,7 @@ import {matchRoutes} from 'react-router-config';
*/
export default function preload(pathname: string): Promise<void[]> {
const matches = Array.from(new Set([pathname, decodeURI(pathname)]))
.map(p => matchRoutes(routes, p))
.map((p) => matchRoutes(routes, p))
.flat();
return Promise.all(matches.map((match) => match.route.component.preload?.()));