Skip to content

Instantly share code, notes, and snippets.

@Mr-Malomz
Created March 10, 2023 11:03
Show Gist options
  • Save Mr-Malomz/212534b2b7f9c6d5dd58172d49f81cdd to your computer and use it in GitHub Desktop.
Save Mr-Malomz/212534b2b7f9c6d5dd58172d49f81cdd to your computer and use it in GitHub Desktop.
use yew::prelude::*;
#[derive(Properties, PartialEq)]
pub struct MessageProp {
pub text: String,
pub css_class: String,
}
#[function_component(Message)]
pub fn message(MessageProp { text, css_class }: &MessageProp) -> Html {
html! {
<p class={css_class.clone()}>
{text.clone()}
</p>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment