【发布时间】:2021-12-25 22:48:40
【问题描述】:
Test.jsx
function Parent({ children }) {
return <div>{children("Test")}</div>
}
function Test() {
return (
<Parent>
{ test => <div>{test}></div> }
</Parent>
)
}
得到一个错误,说children is not a function,但我在互联网上看到其他例子说这有效。有谁知道为什么?在 Preact X 上。
【问题讨论】: