I know that a React Fragment can be used to group child components like this:
render() {
return (
<React.Fragment>
<Foo />
<Bar />
<Baz />
</React.Fragment>
);
}
But can you add props to it? Say you want to use the spread operator:
<React.Fragment {...otherProps}>
...
</React.Fragment>
No, you can't. As per the React docs on Fragments:
Therefore, if you want to add props to a wrapper component, switch to a good ol' div.