且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ReactJS渲染字符串与不间断空格

更新时间:2023-01-10 10:21:19

Instead of using the   HTML entity, you can simply use the Unicode non-breaking space character:

<div>{myValue.replace(/ /g, "\u00a0")}</div>