How to concatenate two JSX fragment or variables or string and component (in Reactjs)?

前端 未结 5 1735
粉色の甜心
粉色の甜心 2020-12-29 01:30

I know JSX can be very misleading because it looks like strings and it is not, thus the \"string\" term in the question, even if we are not really manipulating strings.

5条回答
  •  生来不讨喜
    2020-12-29 01:55

    If you are okay using a parent object such as another div you can also do it this way:

    let line = ;
    if(line.created_at) {
        return 
    {line.created_at}
    {line}
    ; } else { return chat_line; }

提交回复
热议问题