Ok, I realized that :class-properties
seem to set like static class level fields, so it'll be shared between multiple instance of a component. For ref that was weird, so this is how to do refs with class based components:
(rum/defcs MyComponent <
{:will-mount #(-> % (assoc ::some-ref (rum/create-ref)))
:did-mount
(fn[state]
(.scrollIntoView (rum/deref (::some-ref state)))
state)}
[state]
[:div {:ref (::some-ref state)}])
I think you meant (::some-ref state)
😄 in [:div {:ref (:some-ref)}])
Oh yup, I did. Will fix.