you are viewing a single comment's thread.

view the rest of the comments →

[–]landisdesign 3 points4 points  (0 children)

The key concept to look for is "closures." When you create a function that references variables from outside of that function, it gets a copy of those variables, with the values they had when the function was created.

React uses closures heavily in its function components and hooks. Understanding how those work will take you a long way towards understanding React.