Closed lilactown closed 1 year ago
I am experimenting with an implementation of this, but do we really want to add this?
The createRef
is only really useful in class component, but that is rather awkward to use in Helix IMO, for three reasons:
defcomponent
makes several assumptions about statedefcomponent
does not have a clj-kondo linter, so one needs to ignore it or use def-catch-all
, which is a worse DX than defnc
.We found it useful when doing some interop between reagent and helix, where we needed to create a ref in a reagent component and pass it to a helix component. I agree that it shouldn't be used except in niche scenarios like that.
Example usage: