Code Monkey home page Code Monkey logo

Comments (4)

issue-label-bot avatar issue-label-bot commented on August 17, 2024

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

from yew-router.

saschagrunert avatar saschagrunert commented on August 17, 2024

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.

Boscop avatar Boscop commented on August 17, 2024

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.

saschagrunert avatar saschagrunert commented on August 17, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.