gpt4 book ai didi

reactjs - `react-text`是什么?

转载 作者:行者123 更新时间:2023-12-03 14:13:45 30 4
gpt4 key购买 nike

什么是react-text

代码中不存在,但渲染后出现在html中

enter image description here

最佳答案

React 尝试区分最小数量的 dom,并且需要跟踪为每个 child 渲染的 dom。对于空字符串子代,它使用这些注释标记来跟踪它。所以不,您不能(也不应该)删除它们。

更多

https://facebook.github.io/react/blog/2016/04/07/react-v15.html#no-more-extra-ltspangts

We received some amazing contributions from the community in this release, and we would like to highlight this pull request by Michael Wiencek in particular. Thanks to Michael’s work, React 15 no longer emits extra nodes around the text, making the DOM output much cleaner. This was a longstanding annoyance for React users so it’s exciting to accept this as an outside contribution.

更多更多

如果您不渲染任何内容,例如,这些将不会出现。但对于像 (空格)这样的字符串,这些将会出现。

关于reactjs - `react-text`是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45095153/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com