Comments (3)
Hi @foxkdev
This is by design. When you reset, you clear everything before the reset and the reset component becomes the root component. Since the respective component [channel]
doesn't exist after the reset, it won't provide the parameter to the route.
It's possible that we can create a solution for this, but it has to work with
- render
- load
- parameters
For instance, if you have a site that's protected by the load function, you might want to reset (disable) the root load
at /tenants
and at /tenants/[id]/
you want to reset the view, but in both case you want to access the parameters from the entire URL.
Currently the route fragments (components) before the reset component are simply removed before the route is processed. This doesn't allow for much flexibility, but we could instead tag the fragments like this:
// pseudo route fragment
{
node: RNode,
params: {},
shouldLoad: true, // new prop
shouldRender: true, // new prop
shouldProvideParams: true // new prop
}
I can't tell if this is straight forward yet, but I'll have a look.
from routify.
I think for better usage when im reset is becase I want reset module(layout), not params.
for example i have this routes:
- [channel]/profile.svelte
- [channel]/iframe.svelte
- _module.svelte
- _module-full.svelte
view /[channel]/profile use module but [channel]/iframe i want use module-full, so in this view im reset, but im need access to params.
I think this is normal usage, I suggest:
have meta param reset to reset all(module and params) and create new param "module"(by default 'module') to assign module custom but with rest of params.
from routify.
🎉 This issue has been resolved in version 3.0.0-next.157 🎉
The release is available on:
Your semantic-release bot 📦🚀
from routify.
Related Issues (20)
- Routify doesn't work in Vite+Svelte using serve HOT 1
- Incorrect typescript definition for `afterPageLoad` helper HOT 2
- Encountering error while running `npm run dev` for Routify Template HOT 1
- $param containing dot (".") results in 404
- Handling /index paths HOT 8
- [Routify V3] <div id="..."> wrappers created for every part of the route, even though they are not part of any page or module HOT 2
- Option to preload scripts but not render component. HOT 5
- Change URL without navigating to it HOT 2
- [Routify V3] SSR (or at least prerendering) seems to be broken in 3.0.0-next.162 HOT 2
- $params broken (search params missing) after ~v3.0.0-next.174 HOT 5
- Invalid packaging HOT 2
- $isActive {recursive: false} broken HOT 1
- Module replacement directive doesn't have any effect HOT 1
- Uncaught DOMException: Failed to execute 'replaceState' on 'History' when returning a redirect from a module HOT 2
- RouteNode typescript error when using $route.path store
- Compatibility with Vite 5 HOT 2
- v3: Inlined meta doesn't work for index files HOT 4
- v3: derived helpers became broken after svelte migration from 3.x to 4.x HOT 3
- TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from routify.