© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Sebastian
Simpliest way would be to carry the id via url attribute.
<Link to={'routetonext?id='+user._id}><button>next</button></Link>
so unless you neet the ID on the button for other purposes you can simply lift the user id one level up in the Link Tag
Link
Tonny Hideyori
Stay foolish
so i want it for comparing data with other existing id from database when the next component is mounted
Then this should do the trick. The component grabs the ID from the URL (location prop) and do its thing.
Use this class to easy parse the data from the url
developer.mozilla.org/de/docs/Web/API/URLSearchPa…