You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/refs-and-the-dom.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Your first inclination may be to use refs to "make things happen" in your app. I
33
33
34
34
> Note
35
35
>
36
-
> The examples below have been updated to use the React.createRef() API introduced in React 16.3. If you are using an earlier release of React, we recommend using [callback refs](#callback-refs) instead.
36
+
> The examples below have been updated to use the `React.createRef()` API introduced in React 16.3. If you are using an earlier release of React, we recommend using [callback refs](#callback-refs) instead.
37
37
38
38
### Creating Refs
39
39
@@ -56,7 +56,7 @@ class MyComponent extends React.Component {
56
56
When a ref is passed to an element in `render`, a reference to the node becomes accessible at the `current` attribute of the ref.
57
57
58
58
```javascript
59
-
constnode=this.myRef.current
59
+
constnode=this.myRef.current;
60
60
```
61
61
62
62
The value of the ref differs depending on the type of the node:
0 commit comments