You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example documentation at https://dioxuslabs.com/learn/0.4/router/example/first-route the PageNotFound Component is not working as I expected. I am not receiving any routes in the string vector (length of vec == 0). Url is changing fine.
No other behaviour when I used a Link explicitly to the PageNotFound Route with example routes in the vec. 🙂
Steps To Reproduce
Steps to reproduce the behavior:
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_router::prelude::*;
fn main() {
dioxus_web::launch(App);
}
#[derive(Routable, Clone)]
enum Route {
#[route("/")]
Home {},
#[route("/blog/:number")]
Blog { number: usize },
// PageNotFound is a catch all route that will match any route and placing the matched segments in the route field
#[route("/:..route")]
PageNotFound { route: Vec<String> },
}
pub fn App(cx: Scope) -> Element {
render! { Router::<Route> {} }
}
#[inline_props]
fn Home(cx: Scope) -> Element {
render! {
h1 { "Welcome Home!" }
Link {
to: Route::PageNotFound {
route: vec!["Hello".to_string(), "World".to_string()],
},
"To PageNotFound"
}
}
}
#[inline_props]
fn Blog(cx: Scope, number: usize) -> Element {
render! { h1 { "Blog: {number}" } }
}
#[inline_props]
fn PageNotFound(cx: Scope, route: Vec<String>) -> Element {
let length = route.len();
render! {
h1 { "route length: {length}" }
h1 { "Page not found" }
p { "We are terribly sorry, but the page you requested doesn't exist." }
pre { color: "red", "log:\nattemped to navigate to: {route:?}" }
Link { to: Route::Home {}, "Home" }
}
}
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Dioxus version: [v0.4.0]
Dioxus-Web version: [v0.4.0]
Dioxus-Router version: [v.0.4.1]
Rust version: [v1.70.0, stable]
OS info: [Windows]
App platform: [web]
Questionnaire
I'm interested in fixing this myself but don't know where to start
I would like to fix and I have a solution
I don't have time to fix this right now, but maybe later
The text was updated successfully, but these errors were encountered:
In the example documentation at https://dioxuslabs.com/learn/0.4/router/example/first-route the PageNotFound Component is not working as I expected. I am not receiving any routes in the string vector (length of vec == 0). Url is changing fine.
No other behaviour when I used a Link explicitly to the PageNotFound Route with example routes in the vec. 🙂
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Questionnaire
The text was updated successfully, but these errors were encountered: