UIx
September 16, 2024 ยท View on GitHub
https://pitch-io.github.io/uix/docs/
Properties
- DIFFERENCE: UIx doesn't do recursive transformation of component properties to JS like Reagent
- This is a good feature for performance and usability (so you are able to send Clj data into components when needed)
- But it means when you need to use JS objects are values of component properties, you need to use
#js(or other ways) to create the values. - TODO:
:sxproperty values can be in most cases validated with a custom Clj-kondo linter
- RECOMMENDATION: When using React components from JS libs (like MUI) prefer writing the properties
in
camelCase- This way your code matches the examples of the JS libs
- Though UIx does snake-case to camelCase tranform for component top-level properties, it doesn't affect
property values built with
#jslike you would often do with:sxvalues.
Hooks
https://pitch-io.github.io/uix/docs/hooks.html
- RECOMMENDATION: Prefer UIx hook wrappers to calling React directly
- Enables UIx linting
- Will coerce
nilreturn values tojs/undefinedfor effects hook
- NOTICE: React compares hook dependency values with JS
===/Object.is- If you use Cljs data structures as dependencies, their identity can (and often will) be different
even if they are equal (according to Cljs
=) - UIx hook wrappers stringifies keywords, symbols and UUIDs
- If you use Cljs data structures as dependencies, their identity can (and often will) be different
even if they are equal (according to Cljs