如何使用反应酶检查实际的DOM节点 [英] how to check the actual DOM node using react enzyme

查看:63
本文介绍了如何使用反应酶检查实际的DOM节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法获得实际的DOM节点,所以我可以使用Dom api查询它,而不是需要使用酶的api,它只适用于边缘情况,例如我需要断言关于dom节点的事情本身。

Is there a way to get the actual DOM node so I can the query it with the Dom api as opposed to being required to use enzyme's api, it's just for edge cases where for example I need to assert things about the dom node itself.

推荐答案

好像最近添加了这个功能,你可以做 wrapper.getDOMNode()

It seems like this functionality was added recently, you can do wrapper.getDOMNode()

酶文件

这篇关于如何使用反应酶检查实际的DOM节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆