【发布时间】:2019-10-31 22:05:59
【问题描述】:
我有一个问题,我不确定是否可能。 这是一个示例代码。 我有一个组件,我希望他们每次使用我的组件和一个孩子 它应该只接受特定的组件。
例如:
<tableComponent>
<tableHeaderComponent/>
<tableHeaderComponent/>
<tableHeaderComponent/>
</tableComponent>
but for this type it should not be accepted
<tableComponent>
<th>blah</th>
<th>blah2</th>
<yourowncomponent/>
</tableComponent>
谢谢, 乒乓球
【问题讨论】:
-
stackoverflow.com/questions/49706823/… 这可能是您的完美解决方案
-
好吧,我想说的是,只记录预期的用例而不提供该用例之外的任何支持就足够了。
标签: reactjs