Comments (4)
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.
from yew-router.
Yeah I agree. I can’t verify it right now but we may find a manual way for the user to trigger the routing based on the initial route. I think both are valid use cases:
- route always to the target route
- route always to the initial route independently what specified
from yew-router.
Yes, it's good to let users control this. E.g. If upon pageload, url and Default
route differ, the app might want to set the url to match the Default
route, instead of the other way round.
The app would do it in the create
method:
I realized, it's possible already, without any changes to yew-router, I updated my history_state
example to do this:
It now does router_agent.send(yew_router::Request::GetCurrentRoute);
in RootComponent::create()
.
But if upon pageload the url is invalid, and ends up mapping to the Default
route, currently it doesn't set the url to match that route.
from yew-router.
Yeah cool. I also was not sure if the feature belongs to yew-router, but we could provide some helper methods or a setting to specify the behavior from the user side... :)
from yew-router.
Related Issues (6)
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 yew-router.