#How to get the current route url on serverside

3 messages · Page 1 of 1 (latest)

zealous vigil
#

Hello ! I have a sidebar with menu items and i want to conditionaly mark active the current menu with an url check.

I don't really know how to access to current path url on serverside. If i switch to clientside component i have an error: Error: Hydration failed because the initial UI does not match what was rendered on the server.

zealous vigil
#

it's really strange on the server router i don't have any route data

silver abyss
#

It's a bit hacky, but you can get the current root path via: children.props.childProp.segment