Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate parent paths in url bar

Using:

"react-router": "^2.0.0",
"react-router-relay": "^0.9.0",

When I push any link under a parent path, the parent path is duplicated in the URL bar once for every new router.push call.

// http://localhost:3000

router.push('auth/profile')
// http://localhost:3000/auth/profile

router.push('auth/profile')
// http://localhost:3000/auth/auth/profile

router.push('auth/browse')
// http://localhost:3000/auth/auth/auth/browse

When I log the location (from react-router), it does not show the duplicates. Maybe the browser is pushing the parent path onto the basename?

like image 892
rojobuffalo Avatar asked Dec 11 '22 18:12

rojobuffalo


1 Answers

Changing

router.push('auth/profile')

to

router.push('/auth/profile')

fixed this.

like image 197
rojobuffalo Avatar answered Jan 01 '23 04:01

rojobuffalo