In React, refs are like player numbers. They allow you to identify and manipulate specific elements in your application's DOM so that you can modify their behavior or properties when needed.
You might use a ref to get the value of an input field or to focus on a particular element when a button is clicked.
In this tutorial, I'm using refs to access the button from DOM and to change its appearance. Also, I'm using ref to create a communication between parent and child component.
************************************************************
Previous Video: • Code Splitting in Reactjs #19 React C...
Next video: • Type-checking with Proptypes in React...
Full series • Full React Course
************************************************************
0:00 Intro
0:44 Creating ref for a button
2:55 Parent/Child Communication with refs
🧿 I discussed:
✔️ Why we should use refs in Reactjs
✔️ How to implement refs in Reactjs
✔️ How to implement parent-to-child communication with refs in Reactjs
✔️ How to change button style with refs in Reactjs
************************************************************
👉 Linkedin:
✔️ / slobodan-gajic
👉 Instagram:
✔️ / codewithsloba