I have completed a course where instructor used Aux component to get rid of adding extra nodes to the DOM like below:
const Aux = props => props.children
export default Aux;
React has also a default component React.Fragment to get rid of adding extra nodes to the DOM.
I know they both are same. Is it right? If yes, which one is better?
If no, What's the difference between them?
They are basically the same. I use <> </> which is React.Fragment but even simpler, I believe it came out for last and looks better in my opinion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With