i have react class component that have event
constructor(props) {
super(props);
this.monthRef = React.createRef();
this.yearRef = React.createRef();
this.state = {
moIndexActive: props.initialMonth - 1,
yeIndexActive: years.findIndex(y => y === `${props.initialYear}`),
};
}
//some code blablabla
// this error occur in this line bellow
componentWillUnmount() {
this.monthRef.current.removeEventListener('scroll');
this.yearRef.current.removeEventListener('scroll');
}
this component used in functional component,
when i test the functional component there is error message

i am using React Testing Library for test this, i already searched on google but not yet found solution for this, please help me. if there is any way to mock the removeEventListener on react testing library or Jest. thanks in advance.