Skip to content

Commit

Permalink
Fix #549 Propagate parent to hooks components (#550)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
holyjak authored Jan 22, 2024
1 parent d3099e8 commit 7d4440a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/com/fulcrologic/fulcro/components.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7d4440a

Please sign in to comment.