No docs for Getting URL params
See original GitHub issueThe doc here isn’t useful since it doesn’t use chunks:
{
path: '/tasks/:id',
action({ params }) {
const resp = await fetch(`/api/tasks/${params.id}`);
const data = await resp.json();
return data && {
title: data.title,
component: <TodoItem {...data} />
};
}
}
This assumes <TodoItem />
is already loaded, which is exactly what I DON’T want to do.
Where can I see a full example of this implementation?
I tried many different variations with action
and none works.
I can make a PR with decent docs with some guidance 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to get the URL without any parameters in JavaScript?
Use the URL() constructor, then extract and concatenate the origin and pathname. This will automatically strip the search (aka query) parameters from the ......
Read more >How to Get URL Parameters with JavaScript - SitePoint
In this article, we'll show you how to parse and manipulate URL parameters using JavaScript. Getting a URL Parameter. In modern browsers, this ......
Read more >How to Get URL Parameters - W3docs
Read this JavaScript tutorial and learn how you can easily get the URL parameters with the help of the methods provided by the...
Read more >URLSearchParams - Web APIs - MDN Web Docs
Chrome Edge
URLSearchParams Full support. Chrome49. Toggle history Full support. Edge...
@@iterator Full support. Chrome49. Toggle history Full support. Edge...
URLSearchParams() constructor Full support. Chrome49. Toggle...
Read more >Spring cleaning: the URL Parameters tool - Google Developers
In short: We're deprecating the URL Parameters tool in Search Console in 1 month. There's no action required from the current users of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m new to route code splitting, how is this possible?
how can webpack prepare the chunks without knowing them at compile time?
In anyway I think it will be great addition to the docs, along with a nested route example.
Thanks @frenzzy , YOU ROCK!