0
這可能嗎?是否可以通過將組件包裝到另一個組件中來更改組件的呈現輸出?
<span>foo</span>
// ==> <span>foo</span>
<spansToDivs>
<span>foo</span>
</spansToDivs>
// ==> <div>foo</div>
const component1 = children => <span>{children}</span>
<component1>foo</component1>
// ==> <span>foo</span>
<spansToDivs>
<component1>foo</component1>
</spansToDivs>
// ==> <div>foo</div>