DEV Community

Discussion on: How to easily render multiple elements in React

Collapse
 
dance2die profile image
Sung M. Kim

Thanks for sharing the ways to render multiple components.

I'd like to point out that, when you return an array of elements, you need to separate each element with ,.

function Columns() {
  return [
    <td>Hello</td>,
    <td>World</td>
  ];
}

Collapse
 
napoleon039 profile image
Nihar Raote

Oops, I forgot that. Thanks for pointing it out. I thought I had checked everything.

Collapse
 
dance2die profile image
Sung M. Kim

Thanks for the updated code snippets~