Fork me on GitHub
#clojurescript
<
2016-06-27
>
vandr0iy07:06:36

I'm unable to render correctly a table 8x8 in reagent; It says that "Warning: Every element in a seq should have a unique 🔑 ([:tr ([:td "7-0"] [:td "7-1"]..." but in my code I do assign a unique key to everyone: `(defn board [] [:table.board [:tbody (for [i (range 8)] ^{key (str "tr_" (- 7 i))} [:tr (for [j (range 8)] ^{:key (str "td_" i "_" j)} [:td (str (- 7 i) "-" j)])])]])`

vandr0iy07:06:44

am I missing some element to assign a key to?

danielbraun07:06:58

try instead of attaching metadata, to pass key as prop

danielbraun07:06:21

you need a key whenever a sequence is used

danielbraun07:06:28

so for every for, map etc

danielbraun07:06:52

specifically your :tr and and :td.

vandr0iy07:06:29

and how do I do that? I'm new to clojurescript, I did only clojure before

danielbraun08:06:15

[:tr {:key i} "...."]

vandr0iy08:06:50

it worked - no more warning of that kind. Thank you a lot!

danielbraun08:06:16

enjoy. :thumbsup:

martinklepsch11:06:26

just got this compilation error with 1.9.93 , not present with 1.9.76:

No such var: string/index-of, compiling:(cljs/source_map.clj:260:54)

martinklepsch11:06:52

Ah, just seeing that 93 isn't an actual release as per the Github Readme

rohit11:06:37

@martinklepsch: what version of clojure are you using?

rohit11:06:23

I think @darwin was also experiencing something similar. You may need to use clojure 1.8.0+

darwin11:06:19

yep, string/index-of is Clojure 1.8+

martinklepsch11:06:51

@rohit: good catch, project lacked pinning of clojure version 🙂

niquola19:06:56

Hi, could somebody point me modern cljs & node project template with nrepl?

danielcompton20:06:19

@martinklepsch: I find it harder to use this way personally 😞