Effects run after rendering. So you're logging first, and then setting up window.Calendly later.
When you switch to logging window, you're now logging an object. The developer tools do not evaluate what's in that object until you click to inspect it. So by the time you click, window.Calendly exists, but it didn't exist when the log statement ran.
Effects run after rendering. So you're logging first, and then setting up
window.Calendly
later.When you switch to logging
window
, you're now logging an object. The developer tools do not evaluate what's in that object until you click to inspect it. So by the time you click,window.Calendly
exists, but it didn't exist when the log statement ran.