I'm trying to pass the id of a page through React Router, but can't wrap my head around how it should be done.
Here is the link:
<Link to={`/forum/${this.props.match.params.forumcatid}/${this.props.match.params.forumsubcatid}/${thread.subject}`} params={{ threadid: thread.id }}>{thread.subject}</Link>
And here is the router:
<Route exact={true} path="/forum/:forumcatid/:forumsubcatid/:forumthreadid" component={ForumThread} />
I've tried with different approaches, but the id is never passed.
I could just add it as a part of the URL, but I don't want an URL like /forum/324234234/324234/ Instead I want a nice url like so /forum/category/thread/
So how can I pass the id in a hidden way, and keep the names in the url?