admin管理员组文章数量:1390503
My ponent renders HTML using dangerouslySetInnerHTML
property. I need to access this rendered HTML in my enzyme tests. How can I do that?
I already tried ponent.html()
but it returns something like <button ...>[object Object]</button>
.
My ponent renders HTML using dangerouslySetInnerHTML
property. I need to access this rendered HTML in my enzyme tests. How can I do that?
I already tried ponent.html()
but it returns something like <button ...>[object Object]</button>
.
1 Answer
Reset to default 8You can access it via the ponent props ...
const { dangerouslySetInnerHTML: { __html } } = ponent.props();
console.log('__html', __html);
本文标签:
版权声明:本文标题:javascript - How to access actual rendered HTML created by dangerouslySetInnerHTML in Enzyme tests - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744679609a2619320.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论