Answer the question
In order to leave comments, you need to log in
How can React listen for a field change on the global window object?
Tell me, there is a third-party script from Yandex that embeds the Ya.
In my custom component, I need to listen for a change in the window.Ya.adfoxCode field and, in the case when it appears, do something.
I use useEffect, but if you specify window.Ya as a dependency, then the effect does not work.
How can this problem be better solved?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question