cfaester / enzyme-adapter-react-18

MIT License
38 stars 12 forks source link

ShallowWrapper.text() function displays following warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. #14

Open ahmm16 opened 3 months ago

ahmm16 commented 3 months ago

Every time that I use ShallowWrapper.text() function it displays the warning that I mentioned in the title, findDOMNode is disapproved by React in strict mode and this function is inside of your project:

ReactEighteenAdapter.js, line 248. return react_dom_1.default.findDOMNode(item.instance);

Do you have any suggestion to deal with this problem? I tried several time to use the Ref as the warning suggests but I couldn't find a solution.