Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defcomponent with only string as body #1

Open
magnars opened this issue Mar 22, 2019 · 1 comment
Open

defcomponent with only string as body #1

magnars opened this issue Mar 22, 2019 · 1 comment

Comments

@magnars
Copy link
Contributor

magnars commented Mar 22, 2019

(defcomponent hello [greetee]
  (str "Hello " greetee))

fails with:

component.cljc:135 Uncaught TypeError: dumdom.element.inflate_hiccup.call(...).call is not a function

This can be fixed by wrapping the string in any element:

(defcomponent hello [greetee]
  [:span (str "Hello " greetee)])
@cjohansen
Copy link
Owner

I've been looking into this, and currently there is an issue in Snabbdom blocking dumdom from doing this correctly. I will have to re-evaluate when I get some feedback there. I'm not yet sure if it's possible to provide the guarantees for the life-cycle hooks for pure text nodes. If it is, then we'll support this, if it isn't, Dumdom will give you a more friendly error for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants