hi, I know this issue was discussed before but I wasn't able to find a clear answer to this pattern.
First - correct me if I'm wrong, if you don't implement a custom server (http or express) the Link component supports only query string parameters like "/profile?id=123&action=edit" am I correct?
To be able to work with a url params pattern like "/profile/:id" you need to implement a custom server... this was the best I was able to guess going through the examples...
If so - how would you implement a pattern like "/profile/:id/edit"
In the 'parameterized-routing' example the index.js is using links like this one:
<Link href='/blog?ip=first' as='/blog/first'><a>My first blog post</a></Link>
and I wasn't able to decipher what is the necessary workflow on server.js
server.js declares const match = route('/blog/:id')
and then it is unclear what exactly goes to the address bar, and what is the data that is being pushed to the react component?
How do I handle routes like "/profile/:id/edit"
How do I handle many routes in a generic way (coming from react-router I was looking for the match utility equivalent...)
Also, if I have db data fetching before rendering - how can I pass the fetched data to the react component.
All of these are a bit obscure and I would seriously appreciate your help as I was trying to guess my way through with no success.
Thank you
Ajar
This is a set of good questions.
We'll add more info on the docs.
For now, think like this:
/blog?id=first
)blog/:id
See<Link href='/blog?id=first' as='/blog/first' />
Thank you @arunoda !
Simple & clear.
Awesome. gonna close this issue.
Most helpful comment
This is a set of good questions.
We'll add more info on the docs.
For now, think like this:
/blog?id=first
)blog/:id
See<Link href='/blog?id=first' as='/blog/first' />