Function sycamore::render_get_scope
source · [−]pub fn render_get_scope<'a>(
view: impl FnOnce(BoundedScope<'_, '_>) -> View<DomNode> + 'a,
parent: &'a Node
) -> ScopeDisposer<'a>
Expand description
Render a View
under a parent
node, in a way that can be cleaned up.
This function is intended to be used for injecting an ephemeral sycamore view into a
non-sycamore app (for example, a file upload modal where you want to cancel the upload if the
modal is closed).
It is, however, preferable to have a single call to render
or render_to
at the top level
of your app long-term. For rendering a view that will never be unmounted from the dom, use
render_to
instead. For rendering under the <body>
tag, use render
instead.
This API requires the following crate features to be activated: dom