|
|
|
|
|
by ng12
2378 days ago
|
|
Both Vue and React have props. The above code is a snippet; I used the same format as the Vue documentation (which I agree is a little confusing). > Where's the span for x? I assumed Vue was only using the span for v-if, in React we don't need that extra node. > <li>'s are generated by magic? Whoops -- an omission on my part. They should be wrapping the inside of the mapping function. > I just don't like mixing html and js like that, maybe that's why it also seems messy to me. But this is where the magic is. It's exactly why React didn't need to invent a concept for "slots". I admit it's vaguely unfamiliar at first but if it increases both the power and simplicity of your template it's a no-brainer. |
|