Not to be rude, but it shouldn’t matter because you should only talk to your components through their props not by manipulating their state directly.
I don’t think this code will even work, but if it does it probably has issues with hook based components which are the suggested method for building components.
Generally speaking though – set a breakpoint (or put a debugger statement) in the constructor and examine the call stack in your brwoser dev tools. :-)