pub fn use_module_message_effect<Enter, Exit>(
    hooks: &mut Hooks<'_>,
    target_id: Option<EntityId>
)where
    Enter: ModuleMessage + Default,
    Exit: ModuleMessage + Default,
Available on crate feature guest only.
Expand description

Send the Enter message when this Element is mounted, and the Exit message when it is unmounted.

If the target_id is Some, the message will be directed to that target; otherwise, it will be broadcast.