From 7d4440a78890efaba3b8dcfa483c491c3f465b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Hol=C3=BD?= Date: Tue, 23 Jan 2024 00:49:42 +0100 Subject: [PATCH] Fix #549 Propagate parent to hooks components (#550) Issue: The render body of hooks-based components gets its props from the use-fulcro hook, which failed to propagate `fulcro$parent` in the raw JS props. comp/get-parent relies on it, and thus stopped working there. Fix: Add it to the manually tunnelled raw JS props in use-fulcro. --- src/main/com/fulcrologic/fulcro/components.cljc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/com/fulcrologic/fulcro/components.cljc b/src/main/com/fulcrologic/fulcro/components.cljc index 3f4e3344..a74c365a 100644 --- a/src/main/com/fulcrologic/fulcro/components.cljc +++ b/src/main/com/fulcrologic/fulcro/components.cljc @@ -495,10 +495,12 @@ current-state (aget tunnelled-props-state 0 "fulcro$value") props (isoget js-props :fulcro$value) children (isoget js-props :children) + parent (isoget js-props :fulcro$parent) current-props (newer-props props current-state) current-ident (when ident (ident faux-class current-props)) shared-props (when app (shared app))] (doto (gobj/get faux-component "props") + (gobj/set "fulcro$parent" parent) (gobj/set "fulcro$shared" shared-props) (gobj/set "fulcro$value" current-props) (gobj/set "children" children))