Function leptos_meta::use_head

source ·
pub fn use_head() -> MetaContext
Expand description

Returns the current MetaContext.

If there is no MetaContext in this or any parent scope, this will create a new MetaContext and provide it to the current scope.

Note that this may cause confusing behavior, e.g., if multiple nested routes independently call use_head() but a single MetaContext has not been provided at the application root. The best practice is always to call provide_meta_context early in the application.