4 ms·
>> <span>foo {'bar'} {'baz'}</span> well, you just should get the idea that these curly braces are not for interpolation. It's just convenient way to define a
by vogre 11y ago
>> <span>foo {'bar'} {'baz'}</span>
well, you just should get the idea that these curly braces are not for interpolation. It's just convenient way to define a component tree. If you want interpolation, you should use <span>{`foo ${'bar'} ${'baz'}`}</span> syntax.
- k__ 11y agoI dodged this bullet, because the first time I needed a string with two dynamic parts, was in an attribute. This doesn't work: <h1 className='{a} {b}'>...</h1> So I did this: <h1 className={`${a} ${b}`}>...</h1> And then simply used this style everywhere, because it worked for text-nodes and attributes.
- ergothus 11y agoI've worked with a system that was similar to the virtual dom, and I can tell that the ponyfoo author has NOT tried to work with text nodes. Browsers will merge those in an instant. (Side Note: IE in general, including IE11, has had some WEIRD text node behavior, that changes between versions of IE) So making each updatable component an actual (non-text) DOM Node is an unfortunate requirement.