dumdom.inflate/render fails for components without a name
Like the title says, not specifying a component name makes inflation fail when doing SSR.
Example: Simple component:
(defcomponent test-div [data]
[:div (:text data)])
On server side (as part of html string):
(dumdom.string/render (test-div {:text "hello"}))
Then on the client side:
(dumdom.inflate/render (test-div {:text "hello"}) (js/document.getElementById "app"))
dumdom.inflate/render fails with error message "Invalid symbol: /test-div.0.".
Setting a name on all the components rendered makes it work, but I assume that it should work for unnamed components as well.
It seems like the auto-generated names like "/test-div.0" fail because of the leading slash. I also observed other cases were the generated name was a uuid, and these failed with the message "invalid number".
It looks like the namespace part is empty. What does the output of (dumdom.string/render (test-div {:text "hello"})) look like on the server side?
Hi! Sorry about the late answer.
(dumdom.string/render (test-div {:text "hello"}))
Returns:
"<div data-dumdom-key=\""/test-div.0"\">hello</div>"