In this React JS tutorial, we're going to talk about how to set focus on the input field after rendering, a common error you might run into, and how you can use React refs and/or HTML attributes to set autofocus.
Also P.S., apologies in advance for the echo-y audio during the key takeaways! It's something we'll keep in mind (and improve!) in the next video.
Demo code: https://codesandbox.io/s/set-focus-on...
00:14 - working demo
00:50 - buggy code example
2:04 - use React refs to set autofocus
5:04 - using HTML autofocus attribute
6:28 - key takeaways
Connect with a React.js mentor here: https://codemntr.io/2GpMdSG
Find your next React.js project here: https://www.codementor.io/projects/re...
----
Codementor is a platform where you can connect with vetted mentors for 1:1 live programming mentorship, debugging, code review, and more! As long as it's programming related, our mentors can help you.
💻 Find a mentor: http://codemntr.io/learn-more
👋 Come find us on social
Twitter: / codementorio
Instagram: / codementor
#ReactJS #ReactRender #Learnprogramming