Open eromoe opened 7 years ago
You can pass an object to the Link:
<Link to={{
pathname: '/courses',
search: '?sort=name',
hash: '#the-hash',
state: { fromDashboard: true }
}}/>
Will this work for you?
<Link to={
/corpus/${corpusId}/tag}>
Assuming of course the "corpusId" you wanted exists already by the time you make that Link
Well that is just ruining my formatting. basically there are backticks ` around the "/corpus.../tag"
Why are people down voting @luish 's answer?
That's the correct answer according to the docs..
Why are people down voting @luish 's answer?
That's the correct answer according to the docs..
I.. think its because its straight copy-pasted from the react-router docs and isn't tailored to the asker's original question? Which isn't as ideal because, in theory the asker has already seen those docs and didn't quite follow how to get the iteration they desired. People are looking for a little more than C&P, they want a tailored response
Well, my answer replied to the question in the title "How to pass params by Link?" Anyway this is an old issue that hopefully got resolved. 🙂
I would like to know if there's a solution to past params "invisibles" in the query or if the params HAVE to be visibles ?
Hi,
I know I can pass params by Route like
But that require set
component
, andcomponent
must be child of current page. That is inconvenient.I'd like to use Link like
Automatically pass tags to certain component.