Fork me on GitHub
#rum
<
2021-12-14
>
salva-xf00:12:48

I need it as react key, like in https://github.com/tonsky/datascript-chat/blob/3d4b0c456483f2feb0b9af9ab42e94928ecd2743/src/datascript_chat/ui.cljs in line 83 (rum/defc message [msg] (let [user (:message/author msg)] [:.message {:key (:db/id msg) :class [(when (:message/unread msg) "message_unread") (when (:user/me user) "me")]} but when I put it, it doesn't appear in the dom

coby03:12:05

Pretty sure React simply doesn't render key as at attr but I could be wrong. Is the issue that you actually need it in the DOM, or is it just that you expect it to be in the DOM and it's not there? It does not appear in the DOM in that sample app, either. https://tonsky.me/datascript-chat/

salva-xf10:12:43

ok thanks, yes I expect that it is on the dom

Niki13:12:54

You can try using data-key instead