Next.js: Example how to render breadcrumb serverside?

Created on 5 Jul 2017  路  5Comments  路  Source: vercel/next.js

I'm interested in printing or gaining access the current path for rendering a breadcrumb serverside.

I've tried gaining access to the current route via 'next/router' but it's a client-only package?

How would you suggest to do this?

All 5 comments

@ndelangen the url is provided in getInitialProps. After v3 we're going to add a HOC which allows you to get the route on server/client side https://github.com/zeit/next.js/pull/2352

You could use props.url.pathname to do this. There is a PR open #2352 for a withRoute HOC which may help you when that merges 馃槑

same issue.

Same Issue

How can you possibly have the same issue as a 12 months old resolved issue 馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renatorib picture renatorib  路  3Comments

formula349 picture formula349  路  3Comments

wagerfield picture wagerfield  路  3Comments

irrigator picture irrigator  路  3Comments

jesselee34 picture jesselee34  路  3Comments