[英]How can we use dangerouslySetInnerHTML with read-more-react - npm?
how can we set dangerouslySetInnerHTML in text field, it shows error.我们如何在文本字段中设置危险的SetInnerHTML,它显示错误。
<ReadMoreReact text={yourTextHere}
min={minimumLength}
ideal={idealLength}
max={maxLength}
readMoreText={readMoreText}/>
in the "yourtexthere" i want to add dangerouslySetInnerHTML在“yourtexthere”中,我想添加危险的SetInnerHTML
if you are receiving htmlString then you can add read more button Without using read more react package.如果您收到 htmlString 那么您可以添加阅读更多按钮而不使用阅读更多反应包。
Wrap up your content in a div and add maxheight and overflow property to the div.将您的内容包装在一个 div 中,并将 maxheight 和 overflow 属性添加到 div。
now add show more or less button at the end handle the values from the state to update div property maxheight and overflow现在在最后添加显示更多或更少按钮处理来自状态的值以更新 div 属性 maxheight 和溢出
Hope this help you out worked for me.希望这能帮助你为我工作。 Feel free to ask if you don't get it.如果您不明白,请随时询问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.