When I try to define the routes for my app, I get:
error[E0433]: failed to resolve: could not find `exports` in `dioxus_router`
--> src/main.rs:8:35
|
8 | #[derive(Clone, Debug, PartialEq, Routable)]
| ^^^^^^^^ could not find `exports` in `dioxus_router`
|
= note: this error originates in the derive macro `Routable` (in Nightly builds, run with -Z macro-backtrace for more info)
My Cargo.toml:
dioxus = "=0.4.0"
dioxus-web = "=0.4.0"
dioxus-router = "=0.4.1"
wasm-bindgen = "=0.2.87"
My rust code:
#[derive(Clone, Debug, PartialEq, Routable)]
enum Route {
#[route("/")]
// This route will render the Home component with the HomeProps props. (make sure you have the props imported)
// You can modify the props by passing extra arguments to the macro. For example, if you want the Home variant to render a component called Homepage, you could use:
// #[route("/home", Homepage)]
Home {},
}
// create a component that renders a div with the text "Hello, world!"
fn Home(cx: Scope) -> Element {
cx.render(rsx! {
div {"hello world"}
})
}
fn App(cx: Scope) -> Element {
render!{
Router::<Route> { }
}
}
fn main() {
// launch the web app
dioxus_web::launch(Home);
}
Could someone help me ?