diff --git a/lib/app.js b/lib/app.js index 3aee5e3aa8949..e0fcd43b65add 100644 --- a/lib/app.js +++ b/lib/app.js @@ -67,9 +67,19 @@ function propsToState (props) { pathname: router.pathname, back: () => router.back(), push: (url) => router.push(route, url), - pushTo: (url) => router.push(null, url), + pushTo: (href, as) => { + const pushRoute = as ? href : null + const pushUrl = as || href + + return router.push(pushRoute, pushUrl) + }, replace: (url) => router.replace(route, url), - replaceTo: (url) => router.replace(null, url) + replaceTo: (href, as) => { + const replaceRoute = as ? href : null + const replaceUrl = as || href + + return router.replace(replaceRoute, replaceUrl) + } } return {