Answer the question
In order to leave comments, you need to log in
I can't figure out where this error comes from.
I'm working on a project to search for movies on React. Popular movies/serials, etc. are displayed, which you can click on and get to another page with information about them. It seems everything is fine and works, but when you click on some movies, an error flies
TypeError: Cannot read properties of undefined (reading 'classList')
at dom7.esm.js:243
at r.forEach (<anonymous>)
at r.addClass (dom7.esm.js:240)
at e.updateSlidesClasses (updateSlidesClasses.js:19)
at e.slideTo (slideTo.js:150)
at e.i.init (core-class.js:532)
at Object.el (init-swiper.js:34)
at swiper.js:136
at gl (react-dom.production.min.js:219)
at zs (react-dom.production.min.js:259)
Answer the question
In order to leave comments, you need to log in
Look where the error points. You take the specified "classList" and see where you use it in the project. You think that it could go wrong. What problems?
For example , here you have such crap
setTimeout(() => {
inputRef.current.classList.remove("error");
}, 1000);
inputRef.current
exists only if there is popularMovies
. getMovies
and make it so that it does not become faster than in a second popularMovies
. How to do it - see for yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question