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:
1 parent
4e955d0e3b
commit
c5f43dd13e
2 files changed
+21
-9
No files matched your search
@@ -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()
|
||||
}
|
||||
Reference in new issue
Block a user