Wouldn't you have to wrap your setTimeout function in a promise for this to work at 5:20? Otherwise I'd assume that isPending has already been flipped back to false if you check for it inside of the setTimeout callback (unless there's some other magic going on)
It's new for me to see an array being passed to the setTimeout's second parameter. I thought it's a number of milliseconds, but array? What does this mean?
Oh wow good eye! Thanks for catching that. That's definitely a typo. The reason it still works and didn't throw an error is because that value is evaluated to a number, so [500] still works. Sharing a JS fiddle to demonstrate how num conversion happens - jsfiddle.net/n7wv0mLt/17/
Interesting feature and very well explained! Thank you! One question, on the RenderName component, could i have used 'data' returned from the useFormStatus hook to get the name to display, instead of passing it directly as a prop?
Very Well Explained .
Thank you!
Great explanation
Wouldn't you have to wrap your setTimeout function in a promise for this to work at 5:20? Otherwise I'd assume that isPending has already been flipped back to false if you check for it inside of the setTimeout callback (unless there's some other magic going on)
Very nice one! Would love to teach the same way in Tamil to my folks! 💯
Wohoo awesome! Let me know if you need help. I will create one in Hindi too. Do you have an editor?
It's new for me to see an array being passed to the setTimeout's second parameter. I thought it's a number of milliseconds, but array? What does this mean?
Oh wow good eye! Thanks for catching that. That's definitely a typo. The reason it still works and didn't throw an error is because that value is evaluated to a number, so [500] still works. Sharing a JS fiddle to demonstrate how num conversion happens - jsfiddle.net/n7wv0mLt/17/
@@shrutikapoor08 Yep, I saw the article called how automatically the numerical values are converted silently by JS! 😅
Interesting feature and very well explained! Thank you!
One question, on the RenderName component, could i have used 'data' returned from the useFormStatus hook to get the name to display, instead of passing it directly as a prop?