3 ms·
Original author here. I don't think nesting is possible in the examples in that post. I'm sure there's some way to get it working that I just haven't figured o
by bryanbraun 7y ago
Original author here.
I don't think nesting is possible in the examples in that post. I'm sure there's some way to get it working that I just haven't figured out yet. Maybe you could replace the default template strings with something using tagged template literals (like https://github.com/developit/htm https://github.com/developit/htm).
You can work around nesting by spinning up new components after the innerHTML assignment, and assigning them with IDs. Here's an example where I've done that:
https://github.com/bryanbraun/music-box-fun/blob/dc899c14adcd4b228b243cee1e88a394e204f805/js/components/note-lines.js#L22-L25 https://github.com/bryanbraun/music-box-fun/blob/dc899c14adc...
Edit: typos