4 ms·
> You don’t! You’re right, but I’m not sure wrapping it in a self calling function is any better to me. It feels like a lot of contortionism to just echo strin
by tambourine_man 3y ago
> You don’t!
You’re right, but I’m not sure wrapping it in a self calling function is any better to me. It feels like a lot of contortionism to just echo strings.
- eyelidlessness 3y agoSure, that’s reasonable if your only concern is echoing strings. Part of what’s appealing to me about JSX is that it’s capable of far more than string output (even in that’s ultimately all you’re producing from it). The thing (usually) produced in a JSX expression is a value, which can be any arbitrary data structure, and can be composed in any arbitrary way you like. Echoing strings—which is to say producing output as a side effect, out of band of a component’s return value—undermines that. It’s totally a valid approach (and makes perfect sense in the context of PHP’s rendering model), it just has a different set of capabilities.