Router decode url params

This commit is contained in:
NikolaBorislavovHristov 2019-10-18 14:59:50 +03:00
parent c430f09376
commit 4941d6755c

View file

@ -64,7 +64,7 @@ const Router = ({ className, onPathNotMatch, ...props }) => {
const matches = pathname.match(routeConfig.regexp);
const urlParams = routeConfig.urlParamsNames.reduce((urlParams, name, index) => {
if (Array.isArray(matches) && typeof matches[index + 1] === 'string') {
urlParams[name] = matches[index + 1];
urlParams[name] = decodeURIComponent(matches[index + 1]);
} else {
urlParams[name] = null;
}