【发布时间】:2020-04-01 04:25:11
【问题描述】:
我知道可以使用 React Fragment 对子组件进行分组,如下所示:
render() {
return (
<React.Fragment>
<Foo />
<Bar />
<Baz />
</React.Fragment>
);
}
但是你可以给它添加道具吗?假设你想使用扩展运算符:
<React.Fragment {...otherProps}>
...
</React.Fragment>
【问题讨论】:
标签: reactjs react-props react-fragment