Your complete guide to mastering the use of "ref" in React
React Ref is a fantastic feature in React that allows you to directly access and manipulate DOM (Document Object Model) elements.
In simpler terms, it's a way to reference a specific element in your React app, giving you the power to modify and interact with it outside of the normal React data flow.
This series is your ultimate guide to mastering the use of ref in React. We'll start with the basics, such as string and callback ref, and then dive into more advanced topics like the
`useRef()`
hook and `forwardRef()`
API.
By the end, you'll have a deep understanding of how to use ref like a pro in your React applications. Get ready to take your React skills to the next level!02
String refs
08 Oct, 2023
03
Store a reference with callback refs
10 Oct, 2023
04
Access the methods of class components
10 Oct, 2023
06
07
08
Create a custom hook returning a callback ref
22 Oct, 2023
09
Make an element draggable
23 Oct, 2023
11
Create a reference using React.createRef()
09 Oct, 2023
12
Reference an element with React's useRef() hook
14 Oct, 2023
13
Build your own drawing board
18 Oct, 2023
14
Drag and drop items within a list
15 Oct, 2023
15
Persist values between renders
15 Oct, 2023
16
Save the previous value of a variable
16 Oct, 2023
17
Detect whether an element is in view
19 Oct, 2023
18
Pass a ref to a custom hook
20 Oct, 2023
19
Merge different refs
24 Oct, 2023
20
Build a tooltip component
26 Oct, 2023
21
22
Use forwardRef with a higher-order component
05 Dec, 2023
23
Recent posts ⚡
Swap items in a sortable list
04 Dec, 2023
Display a placeholder in a sortable list
03 Dec, 2023
Create a sortable list
02 Dec, 2023
Build a drop zone for file uploads
01 Dec, 2023
Read the content of the dropped file
30 Nov, 2023
Preview images before uploading them
29 Nov, 2023
Build a drop file indicator
28 Nov, 2023
Create your own ghost element
27 Nov, 2023
Customize the appearance of a ghost element
26 Nov, 2023
An introduction to HTML 5 drag and drop
25 Nov, 2023
Use a custom drag handle
24 Nov, 2023
Create a linear gauge with discrete values
22 Nov, 2023
Create a time picker
21 Nov, 2023
Linear gauge
20 Nov, 2023
Newsletter 🔔
If you're into front-end technologies and you want to see more of the content I'm creating, then you might want to consider subscribing to my newsletter.
By subscribing, you'll be the first to know about new articles, products, and exclusive promotions.
Don't worry, I won't spam you. And if you ever change your mind, you can unsubscribe at any time.
Phước Nguyễn