Fork me on GitHub
#helix
<
2020-05-01
>
Luis C. Arbildo20:05:32

Hello!, I'm trying to use styled-components with https://github.com/dvingo/cljs-styled-components, but It doesn't work.

(defstyled test-styled :span {:color "blue"})

(defnc NiceComponent []
  (d/div
    ($ (d/div (test-styled "Hello")))))
Any idea?

lilactown20:05:40

you have to tell me what you mean by “doesn’t work” 😄 I don’t have the time to create your example from scratch

Luis C. Arbildo20:05:25

oh sorry, there is an error like

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `app.core/NiceComponent`. 

lilactown20:05:52

($ (d/div (test-styled "Hello"))) this looks wrong

lilactown20:05:02

$ why is that there?

lilactown20:05:41

$ is used to create an element out of a component. d/div and test-styled both create elements, so $ is not needed

4
💯 4
lilactown20:05:04

you would only use $ if you were creating an element out of a React component like:

($ my-component ,,,)

Luis C. Arbildo20:05:39

You right, sorry, I'm retaking helix by a long time

geraldodev23:05:09

Hi, How do you approach integer inputs and set-state . Do you mantain fidedignty with the type while editing calling :value (str value) :on-change (fn-to-convert-to-integer) . Can you share your strategies on this ?