1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
use crate::*; /// Implementation of strongly-typed props extraction for `PrimaryButtonProps`. impl From<VirtualNode> for PrimaryButtonProps { /// Extracts typed props from a `VirtualNode`. /// /// # Arguments /// /// - `VirtualNode` - The virtual node containing attributes. /// /// # Returns /// /// - `Self` - The strongly-typed `PrimaryButtonProps`. fn from(node: VirtualNode) -> Self { PrimaryButtonProps { label: node .try_get_prop("label") .unwrap_or_else(|| "Button".to_string()), onclick: node.try_get_event("onclick"), } } }