Return a 404 when paring the route fails (#3860)
* return a 404 when paring the route fails * add a playwright test for fullstack routing status codes * Fix new playwright test * document SSRError * Make SSRError public and fix clippy * Move the error display bound to the routable trait * fix clippy * return a more generic 404 message * fix router tests
This commit is contained in:
1 parent
7b7357037f
commit
09a4b5eb4e
18 files changed
+253
-46
No files matched your search
@@ -1,19 +1,13 @@
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_history::{History, MemoryHistory};
|
||||
use dioxus_router::components::HistoryProvider;
|
||||
use std::{rc::Rc, str::FromStr};
|
||||
use std::rc::Rc;
|
||||
|
||||
fn prepare<R: Routable>() -> String
|
||||
where
|
||||
<R as FromStr>::Err: std::fmt::Display,
|
||||
{
|
||||
fn prepare<R: Routable>() -> String {
|
||||
prepare_at::<R>("/")
|
||||
}
|
||||
|
||||
fn prepare_at<R: Routable>(at: impl ToString) -> String
|
||||
where
|
||||
<R as FromStr>::Err: std::fmt::Display,
|
||||
{
|
||||
fn prepare_at<R: Routable>(at: impl ToString) -> String {
|
||||
let mut vdom = VirtualDom::new_with_props(
|
||||
App,
|
||||
AppProps::<R> {
|
||||
@@ -46,10 +40,7 @@ where
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
fn App<R: Routable>(props: AppProps<R>) -> Element
|
||||
where
|
||||
<R as FromStr>::Err: std::fmt::Display,
|
||||
{
|
||||
fn App<R: Routable>(props: AppProps<R>) -> Element {
|
||||
rsx! {
|
||||
h1 { "App" }
|
||||
HistoryProvider {
|
||||
|
||||
Reference in new issue
Block a user