Просмотр исходного кода

fix: some dev warnings about missing keys in autocomplete

Peng Xiao 4 лет назад
Родитель
Сommit
fbecc464a3

+ 3 - 2
src/main/frontend/components/block.cljs

@@ -1661,12 +1661,13 @@
                                              [:a {:on-mouse-down (fn [e]
                                                                    (util/stop e)
                                                                    (route-handler/redirect! {:to :page
-                                                                                             :path-params {:name uuid}}))}
+                                                                                             :path-params {:name uuid}}))
+                                                  :key uuid}
                                               (map-inline config title)])))
                                 parents (remove nil? parents)]
                             (reset! parents-atom parents)
                             (when (seq parents)
-                              (interpose [:span.mx-2.opacity-50 "➤"]
+                              (interpose [:span.mx-2.opacity-50 {:key "separator"} "➤"]
                                          parents))))]
              component (filterv identity component)]
          (when (or (seq @parents-atom) show-page?)

+ 2 - 2
src/main/frontend/components/search.cljs

@@ -74,8 +74,8 @@
   [repo uuid format content q search-mode]
   [:div [
          (when (not= search-mode :page)
-           [:div {:class "mb-1"} (block/block-parents {:id "block-search-block-parent" :block? true} repo (clojure.core/uuid uuid) format)])
-         [:div {:class "font-medium"} (highlight-exact-query content q)]]])
+           [:div {:class "mb-1" :key "parents"} (block/block-parents {:id "block-search-block-parent" :block? true} repo (clojure.core/uuid uuid) format)])
+         [:div {:class "font-medium" :key "content"} (highlight-exact-query content q)]]])
 
 (rum/defc highlight-fuzzy
   [content indexes]