pub fn current_status() -> StreamingStatusExpand description
Get the current status of the streaming response. This method is reactive and will cause the current reactive context to rerun when the status changes.
On the client, this will always return StreamingStatus::InitialChunkCommitted.
ยงExample
#[component]
fn MetaTitle(title: String) -> Element {
// If streaming has already started, warn the user that the meta tag will not show
// up in the initial chunk.
use_hook(|| {
if current_status() == StreamingStatus::InitialChunkCommitted {
dioxus::logger::tracing::warn!("Since `MetaTitle` was rendered after the initial chunk was committed, the meta tag will not show up in the head without javascript enabled.");
}
});
rsx! { meta { property: "og:title", content: title } }
}