Fork me on GitHub
#reagent
<
2016-05-11
>
mccraigmccraig08:05:32

is there a reason why :keys for components in dynamic lists can't be given by the child-component renderers ? i.e. why this generates warnings https://www.refheap.com/aa66ef34cb2afbcf619f38243 so this is required to correctly associate :keys https://www.refheap.com/7db886d73d210b4b9eec99c2e

rohit11:05:24

@mccraigmccraig: looking at the documentation: > The key should always be supplied directly to the components in the array, not to the container HTML child of each component in the array

rohit11:05:20

The two code samples you've provided are similar to the "WRONG" and "Correct" examples in that doc (i think)

rohit11:05:16

(defn an-integer
  [n]
  ^{:key n}
  [:li n])
is the same thing as
(defn an-integer
  [n]
  [:li {:key n} n])

rohit11:05:42

note this only holds true for key

mccraigmccraig11:05:16

ha @rohit i should RTFM more carefully, thanks for doing that for me simple_smile

rohit11:05:38

@mccraigmccraig: actually i had also experienced this issue and never bothered to figure out the answer. your question finally gave me the impetus to find the answer! so thank you as well. simple_smile

ckarlsen15:05:57

i'm trying to build a text editor with draft-js and reagent but I'm encountering the classic problem with async re-rendering and text inputs (sometimes missing key strokes / general weirdness). Since draft-js uses contenteditable div's, reagents "ReagentInput" hack won't work. What's the best approach here? Re implement the hack into my own component?

gadfly36119:05:20

Added keechma profile to reagent-figwheel template: lein new reagent-figwheel myapp +keechma https://github.com/gadfly361/reagent-figwheel

michael.heuberger22:05:18

@nberger @tom but there are few errors in the console. dont know why. thanks for any clues

tom22:05:58

@michael.heuberger: I used reagent.core/create-class like this and it seems to work http://cljsfiddle.com/#gist=5d9556f0f127a24d9b39e75b2b6f6e5a

michael.heuberger23:05:25

then it must be a problem with cljs-react-material-ui itself maybe? @madvas