diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml index c66431d..9975240 100644 --- a/frontend/Cargo.toml +++ b/frontend/Cargo.toml @@ -4,7 +4,11 @@ version = "0.1.0" edition = "2024" [lib] -crate-type = ["cdylib"] +crate-type = ["cdylib", "rlib"] + +[[bin]] +name = "bin" +path = "src/main.rs" [dependencies] yew = { version = "0.23", features = ["csr"] } diff --git a/frontend/index.html b/frontend/index.html index b47c158..3ea8457 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,9 +1,10 @@ + Yew App - + diff --git a/frontend/src/lib.rs b/frontend/src/lib.rs index ea43bee..d09b035 100644 --- a/frontend/src/lib.rs +++ b/frontend/src/lib.rs @@ -1,8 +1,7 @@ -use serde::{Deserialize, Serialize}; use yew::prelude::*; -#[component] -fn App() -> Html { +#[function_component] +pub fn App() -> Html { let counter = use_state(|| 0); let onclick = { let counter = counter.clone(); @@ -19,7 +18,3 @@ fn App() -> Html { } } - -fn main() { - yew::Renderer::::new().render(); -} diff --git a/frontend/src/main.rs b/frontend/src/main.rs new file mode 100644 index 0000000..0577e52 --- /dev/null +++ b/frontend/src/main.rs @@ -0,0 +1,5 @@ +use frontend::App; + +fn main() { + yew::Renderer::::new().render(); +}