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>.

Share Improve this question edited Jan 17, 2018 at 13:53 waka 3,4179 gold badges38 silver badges54 bronze badges asked Jan 16, 2018 at 9:32 Marek TakacMarek Takac 3,04827 silver badges30 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

You can access it via the ponent props ...

const { dangerouslySetInnerHTML: { __html } } = ponent.props();

console.log('__html', __html);

本文标签: