Fork me on GitHub
#reagent
<
2019-12-11
>
Pavel Klavík00:12:03

or using [:div.my-class] directly.

sudakatux10:12:54

So im struggling with some conceptual problem

sudakatux10:12:16

(defn single-header-configuration [{title  :title}]
  (let [type @(rf/subscribe [:session/request-or-response?])]
    (.log js/console "Getting re-rendered" type)
  [:<>
   [:> Typography title]
   [:> Grid
    {:direction "row"
     :container true}
    [:> Grid
     {:xs 8}
     (add-header-form
       {
        :header-type-form type
        })
     ]
    [:> Grid
     {:xs 4}
     (existing-header-cloud
       {:header-type-form type}
       )
     ]]]))

sudakatux10:12:35

My undestanding is... if the type subscription changes

sudakatux10:12:17

then the component gets re-renders the () vs [] should even "force" that re-render in the add-header-form

sudakatux10:12:47

however though i see the console log get printed. The form is not updated with its type

sudakatux10:12:03

it just keeps showing the old type

sudakatux10:12:48

How can i force every single child of single-header-configuration to get re-rendered when type changes

p-himik12:12:57

If you really want to re-render every single child of, say, [:div] when type changes, just use ^{:key type} [:div].

sudakatux11:12:07

Thanks i figured out i was doing a stupid mistake 😛.