fix react cheatsheet refs issue

This commit is contained in:
zehan12 committed 2025-04-08 12:48:38 +05:30
1 parent 69f3a5040b
commit 17a98fdc0b
1 file changed
+2 -4
+2 -4
View File
@@ -627,8 +627,6 @@ const ref = React.createRef();
### Accessing DOM Elements with Refs
### Refs are often used to access and interact with DOM elements directly. Here's an example where we focus an input element using a ref:
```javascript
import React, { useRef, useEffect } from "react";
@@ -645,11 +643,10 @@ function FocusInput() {
export default FocusInput;
```
Note: Refs are often used to access and interact with DOM elements directly. Here's an example where we focus an input element using a ref.
### Managing Focus with Refs
### You can also manage focus between multiple elements using refs:
```javascript
import React, { useRef } from "react";
@@ -673,3 +670,4 @@ function Form() {
export default Form;
```
Note: You can also manage focus between multiple elements using refs.