How to correctly wrap few TD tags for JSXTransformer?

前端 未结 4 707
长发绾君心
长发绾君心 2020-12-13 08:14

I have an array with items and I want to make something like this:


(until have items in array
)
         


        
4条回答
  •  忘掉有多难
    2020-12-13 09:15

    With the release of React 16, there is a new component called Fragment. If are would like to return a collection of elements/components without having to wrap them in an enclosing element, you can use a Fragment like so:

    import { Component, Fragment } from 'react';
    
    class Foo extends Component {
    
      render() {
        return (
          
            
    Hello
    Stack
    Overflow
    ); } }

提交回复
热议问题