You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Reagent has one shortcut to control how components are created:
:> as shortcut to adapt-react-class which in effect calls create-element and converts the Cljs properties to JS object (doesn't wrap the component in Reagent implementation, so Ratoms won't work inside these components)
:<> isn't really shortcut, but just special element
I want to add two more:
Shortcut to call create-element without properties conversion, so Cljs values can be passed to the component as is, without Reagent wrapping the component.
Nice. We could also deprecate :> (keeps working but prints one deprecation notice) and create named version for that (maybe :a> for "adapt"), or even decide one that automatically converts the props isn't that useful.
:r> keeps the props as is, but converts the Hiccup children to React elements. Note that props should be JS object ~always (I think) because React crateElement doesn't work otherwise, and React will also add children property to the JS object.
Currently Reagent has one shortcut to control how components are created:
:>
as shortcut toadapt-react-class
which in effect callscreate-element
and converts the Cljs properties to JS object (doesn't wrap the component in Reagent implementation, so Ratoms won't work inside these components):<>
isn't really shortcut, but just special elementI want to add two more:
create-element
without properties conversion, so Cljs values can be passed to the component as is, without Reagent wrapping the component.[:$ react-component #js {:foo "bar" :cljs-vector [1 2 3]}]
(r/create-compiler {:functional-components? true})
but without changing the compiler.React/memo
as Reagent components are pure, but that might not be the case for React functions?The text was updated successfully, but these errors were encountered: