Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Demonstrates parent and child components.
# yew/demo/child.rs
use yew::prelude::*;
#[derive(Properties, PartialEq)]
struct ChildProps {
text: String,
}
#[function_component(ChildComponent)]
fn child(props: &ChildProps) -> Html {
html! { <p>{ &props.text }</p> }
}
#[function_component(ParentComponent)]
fn parent() -> Html {
html! { <ChildComponent text="Hello from Child" /> }
}
fn main() {
yew::start_app::<ParentComponent>();
}Yew is a modern Rust framework for building client-side web applications using WebAssembly (Wasm), providing a reactive component-based architecture similar to React.
Origin & Creator
Yew was created by Denis Kolodin in 2018 and has since evolved with community contributions into a robust Rust frontend framework.
Industrial Note
Yew is targeted at developers seeking high-performance web applications leveraging Rust's safety, concurrency, and memory efficiency while running in the browser.