Fork me on GitHub
#clojurescript
<
2018-10-07
>
hoertlehner11:10:12

I am displaying a table in reagent. I am displaying multiple rows, each row has its own symbol/name, and then has a vector of floats. So I need a key from the index of the for loop, this is the ^{:key r} But then I need to somehow add the symbol of the row to this index. I tried searching info on the ^ operator, but cannot find anything...

thheller12:10:18

@hoertlehner the ^{:key r} just adds this map as metadata on the following [:td ...] vector

hoertlehner12:10:07

So if I add the metadata not key but key-index

hoertlehner12:10:13

and then in the td I assoc it,

hoertlehner12:10:18

then it should work

hoertlehner12:10:04

In reagent docs I somehow understood that the ^{:key r} adds the index of r as :key.

hoertlehner12:10:37

@thheller Or does the :key get the key of the element, and then reagent then uses the key similarly to the :key map that I can pass on?

hoertlehner12:10:44

I guess that :key has two meanings then really.

thheller12:10:29

I have no idea what reagent does with this. I'm guessing that it takes it to set the react key prop later on

hoertlehner12:10:10

@thheller Thanks! I will play around with it. At least I now have an idea that there is "metadata" in clojure also. Thanks!

cureadvocate15:10:50

/join #re-frame

nustiudinastea22:10:04

Hi folks! Besides my cljs application, I also include two extra files in my index.html file: bootstrap.bundle.min.js and jquery-3.2.1.min.js. Is it possible to get rid of these inclusions and manage these files somehow through my cljs project? I dont really need them in my project but there is functionality like bootstrap dropdown menus that depend on them.