defhook whose body only contains a map now returns a map#js [foo], now are resolved
by :auto-depsuse-memo, use-imperative-handle allow passing a single symbol as its body,
e.g. (use-memo :once x)use-effect allows passing a single symbol as its body, e.g. (use-effect :once cleanup). This will still emit a warning- to silence, you can wrap it
in an anonymous function, e.g. (use-effect :once #(cleanup)).use-effect*, use-memo*, etc.) now accept
:once, :always and will throw an error if passed :auto-deps.^:memo inside a
when) are now caught by the invalid hooks check and included in the Fast
Refresh signature:key prop is now passed as undefined to React. Previously, nil
would be passed directly to React and, if two elements had a nil key, would
produce a confusing duplicate key warning. This change is meant to make it
easier to identify when code meant to generate the :key prop is not working,
as :key is meant to be a string-y value.& correctlysymbolhelix.hooks/use-id that wraps new base React hook useId (@rome-user)helix.core/creat-ref that wraps React.createRef similar to use-ref
(@rome-user):style/indent metadata on $, defnc, defnc-, defhook, and all DOM macroswindow being
available (@rome-user)helix.hooks/wrap-fx is now private (@rome-user)goog.object/extend with js/Object.assign:wrap can now be passed in the metadata map as well as the options map.
A clj-kondo lint warning will occur when using :wrap in the options map.
See https://github.com/lilactown/helix/issues/110:define-factory in clj-kondo hookshgroup element to helix.domdefnc- no longer requires one to refer defnc as wellprovider no longer emits extern warningsuse-state caused an infinite loophelix.dom/marker DOM macrodefnc- which defines a private functional component in the namespace it's called indefcomponent now adds the displayName property as a static, so should show up in devtools nowassoc-some as privateuse-state, when passed multiple arguments, will check whether the first argument is callable before calling apply on it.defcomponent now properly accepts docstringdefnc as a map after the name and before the args list, just like defndefnc, $ et al.deps.cljs which declares dependencies on React. This was causing unnecessary build warnings/errors.
Consumers should install react and react-dom themselves. This will not break existing projects.helix.core/memo without a custom comparator combined with :define-factorygoog.object is globally available(when x [(use-foo)])use- symbol appears in a
quoted form (@SevereOverfl0w)use-callbackdefhook formsfnc for constructing anonymous componentsuse-subscription due to calling pr-str on subscription state every render:check-invalid-hooks-usage by defaulthelix.dom/$d helper for rendering components with DOM props
coercion; e.g. ($d material-ui/button {:class ["foo" "bar"]})use-subscription infinite renderstyle propperformFastRefreshuse-subscription hook that respects Clojure equality:ref and :key props with factory functionsdefnc and $:style prop now accepts an arbitrary JS object as well as a map or vectordeps.cljs which specifies react, react-refresh:class prop for native components now accepts a seq(able) collection, e.g. :class ["foo" "bar"] is equivalent to :class (str foo " " bar).:& works with non-native componentsnil, when the element expected js/undefined:define-factory works with :fast-refresh feature flagCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |