From 7a4b358196922a67a4950a4f372a9962d0366736 Mon Sep 17 00:00:00 2001 From: Shrey Somaiya Date: Sat, 3 Dec 2022 16:13:32 +0100 Subject: [PATCH] update monaco-rust example to yew 0.20 --- examples/yew/Cargo.toml | 2 +- examples/yew/index.html | 8 +++++++- examples/yew/src/main.rs | 7 ++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/yew/Cargo.toml b/examples/yew/Cargo.toml index 2ed8775..070fcad 100644 --- a/examples/yew/Cargo.toml +++ b/examples/yew/Cargo.toml @@ -7,4 +7,4 @@ edition = "2018" [dependencies] monaco = { path = "../..", features = ["yew-components"] } wasm-bindgen = "0.2" -yew = "0.19" +yew = { version = "0.20", features = ["csr"] } diff --git a/examples/yew/index.html b/examples/yew/index.html index 539b3c0..c474ed9 100644 --- a/examples/yew/index.html +++ b/examples/yew/index.html @@ -9,8 +9,14 @@ import init from "./yew.js"; init(); + + - \ No newline at end of file + diff --git a/examples/yew/src/main.rs b/examples/yew/src/main.rs index c3bfaba..57f4ab7 100644 --- a/examples/yew/src/main.rs +++ b/examples/yew/src/main.rs @@ -9,6 +9,7 @@ fn get_options() -> CodeEditorOptions { .with_language("rust".to_owned()) .with_value(CONTENT.to_owned()) .with_builtin_theme(BuiltinTheme::VsDark) + .with_automatic_layout(true) } struct App { @@ -24,17 +25,17 @@ impl Component for App { } } - fn changed(&mut self, _context: &Context) -> bool { + fn changed(&mut self, _context: &Context, _old_props: &Self::Properties) -> bool { false } fn view(&self, _context: &Context) -> Html { html! { - + } } } fn main() { - yew::start_app::(); + yew::Renderer::::new().render(); }