Fork me on GitHub
#reagent
<
2016-02-14
>
tmtwd03:02:51

(defn message-list [messages]
[:ul.content
(for [{:keys [timestamp message name]} @messages]
^{:key timestamp}
[:li
[:time (.toLocaleString timestamp)]
[:p message]
[:p " - " name]])])

tmtwd03:02:24

so in this function ^{:key timestamp} means that reagent/react doesn’t run a diff function on the timestamp field?

peterbak03:02:26

I thought ":key" was used as a way to assign a unique identifier to an elemnt so that react can re-render DOM, but I might be mistaken.