diff --git a/packages/@cra-express/router-prefetcher/src/index.js b/packages/@cra-express/router-prefetcher/src/index.js index 40485188..959edcdf 100644 --- a/packages/@cra-express/router-prefetcher/src/index.js +++ b/packages/@cra-express/router-prefetcher/src/index.js @@ -2,7 +2,8 @@ import { matchPath } from 'react-router-dom'; export function getInitialData(req, res, routes) { const matches = routes.map((route, index) => { - const match = matchPath(req.url, route.path, route); + const { path, exact, strict } = route; + const match = matchPath(req.url, { path, exact, strict }); if (match) { const obj = { route,