This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-12
Channels
- # babashka (4)
- # beginners (49)
- # biff (17)
- # calva (12)
- # cider (5)
- # clojure-czech (1)
- # clojure-europe (3)
- # clojure-norway (3)
- # core-logic (1)
- # cursive (4)
- # data-science (2)
- # datalevin (7)
- # emacs (1)
- # events (6)
- # fulcro (11)
- # helix (7)
- # hyperfiddle (30)
- # lsp (4)
- # podcasts-discuss (1)
- # practicalli (4)
- # releases (1)
- # remote-jobs (7)
- # ring (6)
- # spacemacs (4)
- # tools-deps (5)
I was reading this page: https://gist.github.com/lilactown/c0fd5d8df772412be79a034d627f8ff0
May I ask why this syntax ($ :mesh ...
works?
Can I find some intro of this on https://cljdoc.org/d/lilactown/helix
why i don't need to refer the mesh component to the namespace?
thanks!
yeah. FWIW I would recommend not relying on this behavior, it may change in a future version of helix. Instead, I would create a specific macro that wraps $
that converts the kebab-case props to camelCase and other stuff.
no, either one is fine. But when you pass a string or a keyword to $
, there is some special behavior that happens right now:
• it will convert kebab-case props like :on-click
to camelcase onClick
• it will convert the :style
prop value to a JS object
• it will rename special keys like :class
to className
and :for
to :htmlFor
This behavior may be removed in the future, as it's not general for all renderers; e.g. threejs may want different handling for :style
than React Native.
You can ignore this behavior by doing the pre-processing of :style
yourself and ensuring keys passed to $
are already camelCase