This idea of React has to return a div that contains other things and all results in too many divs! The markup has empty divs just to return two component togethers! So what's the best way to handle this?
React has something called React.Fragment for exactly this reason. Read more on reactjs.org/docs/fragments.html
Yup that looks great! will start using that for sure! Thanks for the tip
There is an excellent shorthand for fragments too!
const Component = () => ( <> <span> Hello World </span> </> );
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
React has something called React.Fragment for exactly this reason. Read more on reactjs.org/docs/fragments.html
Yup that looks great! will start using that for sure! Thanks for the tip
There is an excellent shorthand for fragments too!