This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-18
Channels
- # babashka (12)
- # beginners (35)
- # biff (6)
- # calva (23)
- # cider (7)
- # clj-kondo (10)
- # cljs-dev (15)
- # clojure (81)
- # clojure-dev (2)
- # clojure-europe (13)
- # clojure-germany (1)
- # clojure-korea (2)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-uk (7)
- # clojurescript (23)
- # core-typed (33)
- # cursive (7)
- # data-science (7)
- # datalevin (9)
- # hyperfiddle (1)
- # introduce-yourself (2)
- # malli (1)
- # matrix (17)
- # missionary (24)
- # music (1)
- # off-topic (15)
- # polylith (6)
- # reagent (10)
- # releases (5)
- # remote-jobs (1)
- # shadow-cljs (3)
- # squint (7)
- # xtdb (11)
- # yamlscript (6)
how do reagent handles order of keys for style
when cljs map with over 8 keys doesn't preserve order?
I'm facing an issue (using react directly) with a style map with more than 8 keys, where 2 keys order is important
It doesn't.
Probably the map value is used as is for doseq
or such so you could be able to build a array-map
yourself if you really need.
What properties care about the order?
Or if it doesn't work with React directly, it could be React itself will not care about style property order and it wouldn't help at all if Reagent keeps the order from Cljs array-map -> JS object
this sounds interesting, style props order should not matter within the same block of styles
If I recall Reagent convert-props code, it should also use JS values as-is, so you could write :style #js {...}
and it should use the value for the React element without conversion.
But probably better idea in these cases to use the more specific CSS properties, instead shorthand properties and then specific properties to override something from the shorthand.
Not sure how clear even the CSS spec is about order the properties are read in