Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 1.47 KB

File metadata and controls

6 lines (4 loc) · 1.47 KB

Stale Refs easy #react

by Pawan Kumar @jsartisan

Take the Challenge

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


Back Share your Solutions Check out Solutions