Best practice when adding whitespace in JSX

前端 未结 9 799
粉色の甜心
粉色の甜心 2020-12-02 11:35

I understand how (and why) to add a whitespace in JSX, but I am wondering what\'s best practice or if any makes any real difference?

Wrap both elements in a

9条回答
  •  遥遥无期
    2020-12-02 12:32

    You can use the css property white-space and set it to pre-wrap to the enclosing div element.

    div {
         white-space: pre-wrap;
    }
    

提交回复
热议问题