Fork me on GitHub
#reagent
<
2017-10-16
>
cmal02:10:57

@roman01la Thanks! sorry for late.

cmal07:10:41

Hi, @roman01la! Does cljss support all CSS selectors? If so, how to use, shoud I use them quoted in " " like "ul > li" and "div.the-class-name.another-class-name" if I inject them globally?

Roman Liutikov07:10:01

No, it doesn’t. Everything that’s supported is described in readme

Roman Liutikov08:10:10

You can do pseudos, but not child and element selectors

joshkh14:10:53

what's the advantage of using (r/props) and (r/children) in a render function over accessing them via arguments such as (fn [props & args])?

juhoteperi16:10:54

Probably none, but they are also accessible on other lifecycle methods, where they might not be passed in as arguments

juhoteperi16:10:54

Probably none, but they are also accessible on other lifecycle methods, where they might not be passed in as arguments

andrewboltachev18:10:46

Hello. Is there reagent-friendly version of http://htmltohiccup.herokuapp.com/ ?

andrewboltachev18:10:02

which handles :style etc properly

pesterhazy19:10:59

@andrewboltachev I use that one for reagent all the time

pesterhazy19:10:07

what features are you missing?

andrewboltachev19:10:31

@pesterhazy let's say we have

<div style="background-color: red;">111</div>
which becomes
[:div {:style "background-color: red;"} "111"]

andrewboltachev19:10:59

I got then

Uncaught Error: The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX. This DOM node was rendered by `myproject.views.main_panel`.

andrewboltachev19:10:49

wanna got

[:div {:style {:backgroundColor "red"}} "111"]

pesterhazy19:10:03

would be a cool enhancement

andrewboltachev19:10:46

also would be cool to not to add [:html [:body ...]] around it every time

pesterhazy19:10:06

haha yeah that's pretty redundant

andrewboltachev19:10:15

I've once learned that it's a feature of the parser

pesterhazy19:10:17

still it's super handy

andrewboltachev19:10:41

and got the same html body around IIRC

andrewboltachev19:10:54

ok, may be I'll go for it and try to enhance that tool

achikin20:10:17

I ran into a weird situation

achikin20:10:27

I have the following set of components

achikin20:10:06

And I'm getting a warning "Warning: The same with-let is being used more than once in the same reactive context."

metametadata21:10:34

@achikin no sure, but Reagent doesn't always like lazy seqs, so try (do-all (map-indexed

metametadata21:10:30

plus I guess you forgot to deref the atoms

achikin21:10:03

@metametadata no, and no 🙂 I've tried doall and all atoms are dereferenced properly.

metametadata21:10:35

I mean shouldn't (map-indexed list-item items) be (map-indexed list-item @items)?

achikin21:10:38

Btw it was my second question - why sometimes reagent shows warnings when you don't doall and sometimes not?

achikin21:10:51

@metametadata the code I pasted here is not the actual code, its just a reconstruction, the real code derefs properly.

achikin21:10:25

But still thank you, I've fixed the example.

metametadata21:10:35

I can't answer the second question. I put doall when it asks for it 🙂

rgdelato21:10:25

while we're on the subject, is there any meaningful difference between using (doall (map ...)) and (mapv ...) since I think mapv should be eager?

madstap21:10:43

@rgdelato mapv is indeed eager, but reagent treats sequences different from vectors

madstap21:10:35

Vectors are treated like a new component while lists/sequences are spliced in as children

rgdelato21:10:19

ah, okay. that makes sense