Expand description
§Dioxus Retrouter
code copied from Dioxus 0.3.2 Router
§Overview
This repoistory use for maintain retro-style Dioxus router (before 0.4), I think the old version of router is more friendly to dynamic router.
ⓘ
fn app() {
cx.render(rsx! {
Router {
Route { to: "/", Component {} },
Route { to: "/blog", Blog {} },
Route { to: "/blog/:id", BlogPost {} },
}
})
}
You need to enable the right features for the platform you’re targeting since these are not determined automatically!
§Contributing
- Report issues on our issue tracker.
- Join the discord and ask questions!
§License
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Dioxus by you shall be licensed as MIT without any additional terms or conditions.
Structs§
- Link
Props - Props for the
Link
component. - Parsed
Route - A route is a combination of window title, saved state, and a URL.
- Redirect
Props - The props for the
Router
component. - Route
Context - A
RouteContext
is a context that is provided byRoute
components. - Route
Props - Props for the
Route
component. - Router
Props - The props for the
Router
component. - Router
Service - An abstraction over the platform’s history API.
- UseRoute
- A handle to the current location of the router.
Enums§
- Error
- An error specific to the Router
Functions§
- Link
- A component that renders a link to a route.
- Redirect
- If this component is rendered, it will redirect the user to the given route.
- Route
- A component that conditionally renders children based on the current location.
- Router
- A component that conditionally renders children based on the current location of the app.
- get_
router_ from_ vdom - Get the router service from an existing VirtualDom.
- use_
route - This hook provides access to information about the current location in the
context of a [
Router
]. If this function is called outside of aRouter
component it will panic. - use_
router - This hook provides access to the
RouterService
for the app.
Type Aliases§
- Router
Context - A clonable handle to the router