fix: login example to use proper methods

This commit is contained in:
Jonathan Kelley committed 2022-02-16 14:11:31 -05:00
1 parent c6bdb5db76
commit babe862739
2 files changed
+12 -13

No files matched your search

+1 -1
View File
@@ -106,7 +106,7 @@ impl Drop for UseRouteListener {
}
/// This hook provides access to the `RouterService` for the app.
pub fn use_router(cx: &ScopeState) -> &RouterService {
pub fn use_router(cx: &ScopeState) -> &Rc<RouterService> {
cx.use_hook(|_| {
cx.consume_context::<RouterService>()
.expect("Cannot call use_route outside the scope of a Router component")