This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
@tony.kay I am looking into some false-positives in https://github.com/holyjak/fulcro-troubleshooting and would like to understand why the rad-demo’s LandingComponent has nil
parent (i.e. :props :fulcro$parent
) even though it is under a router, which itself is under Root. (It causes me to mis-identify this component as the root one.) Is there some more reliable way to distinguish a root component (which should have nil ident) from a child one?🙏
Hm. I think that is in the raw props, not the fulcro props. Try looking at
(this-as this
(.-props this))
I probably have a helper fn for that…don’t rmember the name..`raw-props` or something. There is also a comp/parent
helper isn’t there?
The .-props contain nothing useful of the LandingPage component (`C`) - see pic below.
I get (comp/get-parent C) => nil
, because (comp/isoget-in C [:props :fulcro$parent]) == nil
(which is what get-parent calls).
(Where C is (def C (comp/class->any com.example.client/app LandingPage))
)
When I try com.fulcrologic.fulcro.cards.nested-dynamic-routing-tree-cards
then the router’s target has a parent, but LandingPage in rad-demo does not 🤯
But the router there has a parent.
Found it, kind of: when the target component has :use-hooks? true
then it ends up with nil parent (i.e. (comp/get-parent this)
call inside its body returns nil)
ok, thx!