feels like a lot of incidental complexity
but i’m done for the night, thank you for your suggestions 🙂
I mean, ostensibly your classes will almost always show up in something like:
:class "foo bar baz"
I would try and look for patterns like that, instead of matching every form to a class name.
but I don’t know how expressive purgecss isI’ve just cut a new release of helix - 0.0.9. It includes the following changes:
• Fix integration with Fast Refresh that was broken in 0.0.8 (Still WIP, still experimental!)
• $
is a little faster now, due to no longer emitting code that does dynamic dispatch (thanks @darwin!)
• Feature flag :check-invalid-hooks-usage
now emits compiler warnings rather than throwing at macro time
• :check-invalid-hooks-usage
no longer will complain about usages of user
😛 hooks must currently be kebab-case to work with it. Better RegEx foo incoming.
• A new helper helix.core/create-context
• A new defhook
macro which will in the future help with checking for invalid hooks usage, integrating with Fast Refresh, and more.
@lilactown I try to run the example in the Readme but don't work
oops, what’s the error?
the state don't update
(defnc Greeting
"A component which greets a user."
[{:keys [name]}]
;; use helix.dom to create DOM elements
(d/div "Hello, " (d/strong name) "!"))
(defnc App []
(let [[state set-state] (hooks/use-state {:name "Helix User"})]
(d/div
(d/h1 "Science Timeline!")
;; create elements out of components
($ Greeting {:name (:name state)})
(d/input {:value name
:on-change #(do (set-state assoc :name (.. % -target -value))
(println (.. % -target -value)) )}))))
oops, you’re right
(d/input {:value (:name state)
should be the correct code
oh i see
I will write a post about how make web apps in Helix 🙂
I’ve fixed it in the README. Thanks for reporting!
Thank you for the support!
["pigeon-maps" :as pm]
(pm/Map)
What I'm doing wrong?
(defnc AppMap
"A component which show a map."
[{:keys [scientists]}]
;; use helix.dom to create DOM elements
(d/div
(pm/Map)
(d/div "Hello !")))
check out https://github.com/Lokeh/helix/blob/master/docs/creating-elements.md
you might also not be requiring the pigeon-maps lib correctly
try this:
["pigeon-maps" :default Map]
($ Map)
new error
that’s better. try similar what you had before
["pigeon-maps" :as Map]
($ Map)
you can (js/console.log Map)
to see what it’s importing, that might help
getting the requires down for npm libs is a little tricky sometimes