Remove argument from use_hook closure (#496)

Also; update docs for said function
This commit is contained in:
Reinis Mazeiks authored and GitHub committed 2022-07-11 15:50:56 -04:00
1 parent 6ea076fa7f
commit d734dc5b46
29 files changed
+53 -55

No files matched your search

+2 -2
View File
@@ -28,10 +28,10 @@ pub struct RouteProps<'a> {
/// ```
pub fn Route<'a>(cx: Scope<'a, RouteProps<'a>>) -> Element {
let router_root = cx
.use_hook(|_| cx.consume_context::<Arc<RouterCore>>())
.use_hook(|| cx.consume_context::<Arc<RouterCore>>())
.as_ref()?;
cx.use_hook(|_| {
cx.use_hook(|| {
// create a bigger, better, longer route if one above us exists
let total_route = match cx.consume_context::<RouteContext>() {
Some(ctx) => ctx.total_route,