|
|
|
|
|
by acemarke
3123 days ago
|
|
Several people had already noted [0] that you could implement equivalent behavior by using a component that simply returns its own children: const Fragment = ({children}) => children;
// later
return <Fragment><Component1 /><Component2 /></Fragment>;
Nice to see this added as both a built-in component type and a useful syntax extension. (Now if they'd just modify JSX syntax so that we can pass props by matching local variable names similar to how ES6 object literals work, like `<SomeComponent a b c />`, rather than having that become a defaulted-true boolean, I'd be happy :) )[0] https://medium.com/@gajus/using-react-v16-to-create-self-des... |
|
We did mention the author of react-aux in the blog post though :-)
>Thanks to Gajus Kuizinas and other contributors who prototyped the Fragment component in open source.