feat: Allow using NavigationTarget outside router (#3633)

* feat: Allow using `NavigationTarget` outside of router

* chore: Update import

* chore: Update imports

* fmt
This commit is contained in:
Marc Espin authored and GitHub committed 2025-01-28 10:52:48 -08:00
1 parent 4e955d0e3b
commit c5f43dd13e
2 files changed
+21 -9

No files matched your search

+6
View File
@@ -12,3 +12,9 @@ pub fn use_router() -> RouterContext {
pub fn router() -> RouterContext {
dioxus_lib::prelude::consume_context()
}
/// Try to acquire the router without subscribing to updates.
#[doc(alias = "url")]
pub fn try_router() -> Option<RouterContext> {
dioxus_lib::prelude::try_consume_context()
}