I'm Using react version 18.1.0 and @zarconontol/enzyme-adapter-react-18 for enzyme configs.
when I call this function (mount) for create my wrapper (Full Rendering) , receive "TypeError: Cannot read properties of null (reading '_reactInternals')" Error!
const wrapper = mount(<App />);
I have setup function that create my wrapper and simulate some actions on it.
const setup = (state = {}) => {
const wrapper = mount(<App />);
// add value to input box :
const inputBox = findByTestAttr(wrapper, "input-box");
inputBox.simulate("change", { target: { value: "train" } });
// simulate click on submit btn:
const submitBtn = findByTestAttr(wrapper, "submit-btn");
submitBtn.simulate("click", { preventDefault() {} });
return wrapper;
};
So the question is how do I fix this error?
Thanks for your tips :)