Next.js: Get previous page (Browser history)

Created on 4 May 2017  路  2Comments  路  Source: vercel/next.js

Hello. How can I push my router to previous page (like history.back())

Most helpful comment

Actually, you could always use window.history.back().
I think we don't need to expose our own API for this.

All 2 comments

Router.back() -> https://github.com/zeit/next.js/blob/master/lib/router/router.js#L105-L107
It's not documented but it's in the code.

Actually, you could always use window.history.back().
I think we don't need to expose our own API for this.

Was this page helpful?
0 / 5 - 0 ratings