Skip to content

Commit b15f915

Browse files
committed
[experiment] Fix duplicate keys
we passed a seq of two seqs as :children to a v-table. Reagent unpacks the seqs when it renders. Between the two seqs, there are sometimes duplicate keys. @hipitihop caught a warning for this, but I can't repro. Wrapped each inner seq in its own v-table. Ostensibly, this should prevent duplicate keys on child elements. For #412
1 parent 1958ecd commit b15f915

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

src/day8/re_frame_10x/panels/subs/views.cljs

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -458,26 +458,30 @@
458458
:style {:overflow-x "hidden"
459459
:overflow-y "auto"}
460460
:children
461-
[(for [p all-subs]
462-
^{:key (:id p)}
463-
[pod (merge p
464-
(get sub-expansions (:id p))
465-
(get sub-pins (:id p)))])
461+
[[rc/v-box
462+
:children
463+
(for [p all-subs]
464+
^{:key (:id p)}
465+
[pod (merge p
466+
(get sub-expansions (:id p))
467+
(get sub-pins (:id p)))])]
466468
(when (seq intra-epoch-subs)
467-
(list
468-
^{:key "intra-epoch-line"}
469-
[rc/line :size styles/gs-2s
470-
:style {:margin "19px 0px"}]
471-
^{:key "intra-epoch-title"}
472-
[:h2 {:class "bm-heading-text"
473-
:style {:margin "19px 0px"}}
474-
[rc/hyperlink-href
475-
:class (styles/hyperlink ambiance)
476-
:href "https://github.com/day8/re-frame-10x/blob/master/docs/HyperlinkedInformation/IntraEpoch.md"
477-
:label "Intra-Epoch Subscriptions"]]
478-
(for [p intra-epoch-subs]
479-
^{:key (:id p)}
480-
[pod (merge p (get sub-expansions (:id p)))])))]]]]))
469+
[rc/v-box
470+
:children
471+
(list
472+
^{:key "intra-epoch-line"}
473+
[rc/line :size styles/gs-2s
474+
:style {:margin "19px 0px"}]
475+
^{:key "intra-epoch-title"}
476+
[:h2 {:class "bm-heading-text"
477+
:style {:margin "19px 0px"}}
478+
[rc/hyperlink-href
479+
:class (styles/hyperlink ambiance)
480+
:href "https://github.com/day8/re-frame-10x/blob/master/docs/HyperlinkedInformation/IntraEpoch.md"
481+
:label "Intra-Epoch Subscriptions"]]
482+
(for [p intra-epoch-subs]
483+
^{:key (:id p)}
484+
[pod (merge p (get sub-expansions (:id p)))]))])]]]]))
481485

482486
(defn filter-section []
483487
[inputs/search

0 commit comments

Comments
 (0)