Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 1.51 KB

File metadata and controls

6 lines (4 loc) · 1.51 KB

Stale Callback easy #react

by Pawan Kumar @jsartisan

Take the Challenge

We have a simple input and button. The onClick handler of the button is wrapped with useCallback with empty dependencies. Though we are updating state of value on every keystroke, click on the button shows undefined value in the console. Why? What can we do to fix it?


Back Share your Solutions Check out Solutions