Function freya::prelude::SuspenseBoundary

pub fn SuspenseBoundary(
    __props: SuspenseBoundaryProps
) -> Result<VNode, RenderError>
Expand description

Suspense Boundaries let you render a fallback UI while a child component is suspended.

§Example

fn App() -> Element {
    rsx! {
        SuspenseBoundary {
            fallback: |context: SuspenseContext| rsx! {
                if let Some(placeholder) = context.suspense_placeholder() {
                    {placeholder}
                } else {
                    "Loading..."
                }
            },
            Article {}
        }
    }
}