Skip to content

Route redirect to other route, the url path is't change #4093

Closed
@ngd-b

Description

@ngd-b

Feature Request

I setting page routes. and config the path / redirect to another route. but the url is't change

The route config

#[derive(Routable, Clone, PartialEq)]
#[rustfmt::skip]
enum Route {
    #[redirect("/",|| Route::AddNote)]
    #[layout(Home)]
        #[route("/note")]
        AddNote,
    #[end_layout]
    #[route("/:..segments")]
    NotFound { segments: Vec<String> },
}

I think redirect means the route change to target route. so when visited route path / , the page render target route Route::AddNote and the url should change to /note

Implement Suggestion

the url should be changed simultaneously to target route path.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requestrouterRelated to the router implementationwebrelating to the web renderer for dioxus

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions