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

前端 未结 5 1758
粉色の甜心
粉色の甜心 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:48

    For React Native, I prefer this technique:

    1. pro: in contrast to the array technique you don't have to artificially create keys
    2. con: requires the overhead of a containing element (e.g., View, below)
    jsx = first;
    jsx = {jsx}second;
    

提交回复
热议问题