I am trying to find any resources regarding usage of react-bootstrap with reagent in shadow-cljs. Unfortunately, all resources I’ve been able to find were focusing on cljsjs/reagent.
Although it is working, is it still considered valid for shadow-cljs? This adapt-react-class syntax feel a bit redundant to me and I’d rather expect something like:
AFAIK shadow-cljs is agnostic as to which React wrapper you’re using. The syntax you mentioned is Reagent/React interop, not ClojureScript/JavaScript interop.
To answer you question, you’re using the component correctly. There’s a different style that is a bit more concise:
This should work fine. When using adapt-react-class you must do this statically (as a def) since it would otherwise do this for every render which would cause react to re-render every frame since the component type “changed”, since a new class was created.
This however is purely dependent on reagent and not specific to shadow-cljs in any way. :> I believe is just syntax for “render native JS component” so you don’t have to adapt-react-class.