I have two components A and B. I want to switch between the two components on the page.
(defui A) (defui B)
One solution is to use the parent component C:
(defui C (render (let [{:keys [activeView]} props] (if (= activeView 'A') (renderA) (renderB)))))
The problem is the request. C needs to be requested for both A and B, even if one of them is displayed.
I need C to not be included in the request or not request only A or B.
Is this true, or are there workarounds:
- A child component can only request its details, which are transmitted by its parent.
- The parent component must request its children in order to pass them on to the children.
- Only the root component requests the
app-state .
source share