Pau*_*erg 4 reactjs react-props react-fragment
我知道 React Fragment 可用于对子组件进行分组,如下所示:
render() {
return (
<React.Fragment>
<Foo />
<Bar />
<Baz />
</React.Fragment>
);
}
Run Code Online (Sandbox Code Playgroud)
但是你可以给它添加道具吗?假设您要使用扩展运算符:
<React.Fragment {...otherProps}>
...
</React.Fragment>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1952 次 |
| 最近记录: |