I don't have a lot of experience with react. I'm working on a library that expects maps with a ::node
key, and applications using the library use that key to display the thing in the right place. I'm currently using regular js dom nodes, but there's no code in the library that is tied to the node representation.
I'm curious if this is enough to support react based frameworks as well? Can a react component just be a key in a map and then your app can take the value and render it to the dom? Or are there external requirements of react components I'm missing. Does this depend on the cljs react wrapper I'm using, or are they generally able to output a react component object?
a react component is just a function or object, you can certainly store it in side of a CLJS map
if I follow what you’re saying, you mean something like:
(def lib-data
{::node some-react-component})
(react/createElement (::node lib-data) ,,,)
perfect!
FYI I created a new channel #serenity to talk about the lib I posted above