Debugging ReactJs in Chrome on page load is and everything else undefined when using the console
I have a problem while debugging React while loading the start page. As you can see from the screenshot, if I am over this
I can see the content, but if I use the console it says there this
is undefined. This only happens when I reload the page, if I debug on click this problem does not occur. I have it installed React Developer Tools
for Chrome and noted that when this happens it only speaks Connecting to Reactβ¦
. Could this be the problem?
I'm using .tsx
files ( .jsx
but with TypeScript) if that might make a difference.
Sources tab:
Reaction Tab:
source to share
Based on your updated comments, if you run your function from the constructor and then stop it with a breakpoint, the constructor will not complete execution, which means it won't be able to set the prototype chain correctly and most importantly, set the correct reference to this
.
source to share