1

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?

zendevil.eth
  • 974
  • 2
  • 9
  • 28

1 Answers1

1

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

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

Thomas Heller
  • 3,842
  • 1
  • 9
  • 9