How to convert the following js style map to clojurescript?

56 Views Asked by At

I want to write this js style map in cljs:

const pathLength = useSpring(yRange, { stiffness: 400, damping: 90 })

<div style={{
                        pathLength,
                        rotate: 90,
                        translateX: 5,
                        translateY: 5,
                        scaleX: -1, // Reverse direction of line animation
                    }}></div>
                   

I have the following:


[:div {:style  {path-length
               :rotate 90 :translateX 5
               :translateY 5
               :scaleX -1}}]

But the error I get is:

Map literals must contain an even number of forms.

How to fix this?

1

There are 1 best solutions below

0
Thomas Heller On

{ pathLength } in JS is short for { pathLength: pathLength }.

In CLJS you just write {:pathLength path-length}.