import React from 'react'
import Com from './com'
const Text = () => {
const renderDom = () => {
return <div>222222</div>
}
const renderComDom = () => {
return <Com/>
}
return (
<div>
{
renderDom()
}
{
renderComDom()
}
</div>
)
}
export default Text
请问下为什么renderDom
能正常渲染renderComDom
却渲染不出来?
应该是你的 Com 组件return了空标签,然后你下意识觉得渲染没对。