Video Description
In this lesson we look at a common beginner mistake when using state provided by hooks in React. It applies to useState, useReducer, Redux, Zustand, Valtio and probably any other state manager that uses hooks.
The cause: stale values in closures.
Code On Github:
https://github.com/basarat/demo-state-callback-- Part of ReactJS TIPs for Professionals --
Members (no-ads πΉ, early release β‘οΈ, supported by you ππ»):
https://www.youtube.com/playlist?list=PLYvdvJlnTOjGX3hezMwMQWy29j7xMVg5hSubscribers (free π€, scheduled release β±, use the notification bell π):
https://www.youtube.com/playlist?list=PLYvdvJlnTOjHZEkICYcz_pV2SUD80YQ6J π· #basarat #TypeScript #JavaScript #Tutorial
π β€οΈ Subscribe for MOORE β€οΈ π
https://www.youtube.com/basaratali?sub_confirmation=1πΉ Support πΉ
Join:
https://www.youtube.com/c/BasaratAli/join~
https://twitter.com/basarathttps://github.com/basarathttps://basarat.com/