Clarify note regarding <Routes view=... /> (#214)

This commit is contained in:
n-l-i
2025-10-02 00:06:04 +02:00
committed by GitHub
parent 3bb89c97d5
commit 7abf4ca53d

View File

@@ -91,7 +91,7 @@ The `view` is a function that returns a view. Any component with no props works
</Routes>
```
> `view` takes a `Fn() -> impl IntoView`. If a component has no props, it can be passed directly into the `view`. In this case, `view=Home` is just a shorthand for `|| view! { <Home/> }`.
> `view` takes a `Fn() -> impl IntoView`. If a component has no props, it can be passed directly into the `view`. In this case, `view=Home` is just a shorthand for `view=|| view! { <Home/> }`.
Now if you navigate to `/` or to `/users` youll get the home page or the `<Users/>`. If you go to `/users/3` or `/blahblah` youll get a user profile or your 404 page (`<NotFound/>`). On every navigation, the router determines which `<Route/>` should be matched, and therefore what content should be displayed where the `<Routes/>` component is defined.