Function consecuit::construction::mount::mount_app_without_leaking_at[][src]

pub unsafe fn mount_app_without_leaking_at<Ret>(
    function: fn(_: ComponentBuilder, _: ()) -> Ret,
    node: Node
) -> SubtreeInstance<Ret, ()> where
    Ret: ComponentReturn
Expand description

Mount the given component on the given Node, returning a SubtreeInstance which will unmount the app when dropped.

Normally you should use mount_app or mount_app_at. Only use this if you have a way to store the returned value.

The component must be a Consecuit component that takes () (empty tuple) as props.

See crate for what a Consecuit component looks like.

This is unsafe because dropping the returned SubtreeInstance while Consecuit is rendering could cause unsafe behavior.

If you’re going to use it, make sure you keep the SubtreeInstance forever.

If you’re really going to drop it, make sure to NOT do so from inside Consecuit hooks/components/use_effect/…. Dropping from inside an event callback or run_later is probably fine.