JS engine will go through our code starting from the ‘global scope’ The aim of these lines is to understand what happens inside the components every time we update the state. When we call count we access to n from the outer scope (line 2) States update with value or updater Now, can you tell me what will be shown on the screen with this code? What’s your guess?
Table of contents
The fundamentals of JavaScript that every React developer should know to reveal the tricks underneath!AgendaDo you remember what’s Scope?And what about Closures?Where does the state update?States update with value or updaterPrimitives and ReferencesReferences in ReactTakeaways1 Comment
Sort: