Created
September 26, 2022 19:50
-
-
Save Mr-Malomz/b750874e85b2b009a80db231a6580d31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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