From 17a98fdc0b20fdc033b92dae4ad7b8595ccad228 Mon Sep 17 00:00:00 2001 From: zehan12 Date: Tue, 8 Apr 2025 12:48:38 +0530 Subject: [PATCH] fix react cheatsheet refs issue --- source/_posts/react.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/_posts/react.md b/source/_posts/react.md index 77c13e4..de2acb1 100644 --- a/source/_posts/react.md +++ b/source/_posts/react.md @@ -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.