Repro: https://codesandbox.io/s/blissful-napier-k5gvjy?file=/src/index.js
I often use ternary operators for conditional rendering, something like
condition ? html`option 1` : html`option 2`
I noticed that when I don't have an "option 2", I can't simply write
condition ? html`option 1` : html``
because that will throw an error when the condition changes. If the condition doesn't change, it renders fine, no matter if the condition is true
or false
.
My initial workaround was simply filling the second option with a <br>
; it fixed the issue and usually didn't cause any problems.
However, recently I also discovered that I can use null
as well, and the parent template string will render it without a hiccup, so that's probably the preferred way. You might wanna add that to the docs somewhere?
Anyway, hope the repro helps and you can fix the bug, not that the empty template string solution should be encouraged or anything, but it certainly shouldn't break the whole application either (which it currently does).
I absolutely love arrow, it's been a great experience so far and I've even built and launched a full appliation, fully powered by arrow!
Keep up the good work, and let me know if you would like to hear more about my experience with it and my suggestions for useful additions :)