3 added
1 removed
Original
2026-01-01
Modified
2026-02-21
1
-
<p>pages.courses.lessons.theory_unit.sign_up_block_title</p>
1
+
<p>Full access to materials</p>
2
+
<p>Sign up and get access to this and dozens of other courses</p>
3
+
<p><a>Sign up</a></p>
2
<p>Usually we work with the useRef() hook to use DOM elements in useEffect() or event handlers:</p>
4
<p>Usually we work with the useRef() hook to use DOM elements in useEffect() or event handlers:</p>
3
<p>The value inside inputEl appears after we mount the component but before we call the hooks. Don't forget to set the ref attribute for the desired element when you do so.</p>
5
<p>The value inside inputEl appears after we mount the component but before we call the hooks. Don't forget to set the ref attribute for the desired element when you do so.</p>
4
<p>Another way to use useRef() is to store data between component calls. This hook returns a regular object with the current property inside.</p>
6
<p>Another way to use useRef() is to store data between component calls. This hook returns a regular object with the current property inside.</p>
5
<p>The only difference between this object and the manually created { current: ... } is that the hook returns the same object every time we call the component. In its behavior, useRef() is similar to using a regular property inside a class component (this.someproperty).</p>
7
<p>The only difference between this object and the manually created { current: ... } is that the hook returns the same object every time we call the component. In its behavior, useRef() is similar to using a regular property inside a class component (this.someproperty).</p>
6
<p>Below is an example of how you can save the previous state using useRef():</p>
8
<p>Below is an example of how you can save the previous state using useRef():</p>
7
<p>See the Pen<a>use_ref</a>by Hexlet (<a>@hexlet</a>) on<a>CodePen</a>.</p>
9
<p>See the Pen<a>use_ref</a>by Hexlet (<a>@hexlet</a>) on<a>CodePen</a>.</p>
8
<h2>Recommended programs</h2>
10
<h2>Recommended programs</h2>