Build a Business Landing Page with React, Tailwind CSS and Framer Motion

A landing page is often the first thing visitors see when they discover your business.

A good landing page should:

  • Look professional
  • Work perfectly on mobile devices
  • Load quickly
  • Clearly explain your services
  • Build trust
  • Encourage users to take action

In this tutorial, we’ll build a modern landing page using:

  • React
  • Tailwind CSS
  • Framer Motion
  • Responsive Design
  • SEO-friendly HTML

The page will include:

✅ Hero Section

✅ Features / Services Section

✅ About Section

✅ Testimonials Section

✅ Call To Action Section

✅ Smooth Scrolling

✅ Framer Motion Animations

✅ Mobile Responsive Design

Project Structure

src/
├── components/
│ ├── Hero.jsx
│ ├── Features.jsx
│ ├── About.jsx
│ ├── Testimonials.jsx
│ └── CTA.jsx
├── App.jsx
└── index.css

Step 1: Create React Project

npx create-react-app landing-page
cd landing-page

Install dependencies:

npm install framer-motion
npm install -D tailwindcss

package.json
{
"name": "landing-page",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@testing-library/user-event": "^13.5.0",
"framer-motion": "^12.40.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"tailwindcss": "^3.4.19",
"autoprefixer": "^10.5.0"
}
}

Step 2: Configure Tailwind

tailwind.config.js

module.exports = {
content: [
"./src/**/*.{js,jsx}"
],
theme: {
extend: {},
},
plugins: [],
}

postcss.config.js

module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

src/index.css

@tailwind base;
@tailwind components;
@tailwind utilities;
html {
scroll-behavior: smooth;
}

Step 3: Hero Section

components/Hero.jsx

import { motion } from 'framer-motion';
export default function Hero() {
return (
<section id="hero" className='min-h-screen flex items-center justify-center bg-slate-900 text-white'>
<div className='text-center px-6'>
<motion.h1
initial={{ opacity: 0, y: -40 }}
animate={{ opacity: 1, y: 0}}
transition={{ duration: 0.8 }}
className="text-5xl font-bold">
Grow Your Business Faster
</motion.h1>
<motion.p
initial={{ opacity: 0 }}
animate={{ opacity: 1}}
transition={{ delay: 0.3 }}
className='mt-6 text-xl'>
Modern digital solutions for growing companies.
</motion.p>
<a href='#cta' className='inline-block mt-8 bg-blue-600 px-8 py-3 rounded-lg'>
Get Started
</a>
</div>
</section>
)
}

Step 4: Features Section

components/Features.jsx

import { motion } from 'framer-motion';
const features = [
"Web Development",
"Mobile Apps",
"SEO Optimization",
"Cloud Solutions"
];
export default function Features () {
return (
<section id="features" className='py-20 bg-gray-100'>
<div className='max-w-6xl mx-auto px-6'>
<h2 className='text-4xl font-bold text-center'>
Services
</h2>
<div className='grid md:grid-cols-2 gap-8 mt-12'>
{
features.map((item) => (
<motion.div
whileHover={{ scale: 1.05 }}
key={item}
className='bg-white p-6 rounded-xl shadow'>
<h3 className='text-xl font-semibold'>{item}</h3>
</motion.div>
))
}
</div>
</div>
</section>
)
}

Step 5: About Section

components/About.jsx

export default function About() {
return (
<section id='about' className="py-20">
<div className="max-w-4xl mx-auto px-6 text-center">
<h2 className="text-4xl font-bold">
About Us
</h2>
<p className="mt-6 text-lg">
We help business build modern
digital products that increase
growth and customer engagement.
</p>
</div>
</section>
)
}

Step 6: Testimonials Section

components/Testimonials.jsx

export default function Testimonials() {
const testimonials = [
{
name: "John",
text: "Amazing service and support."
},
{
name: "Sarah",
text: "Helped our company grow rapidly."
}
];
return (
<section id='testimonials' className="bg-gray-100 py-20">
<div className="max-w-6xl mx-auto px-6">
<h2 className="text-4xl font-bold text-center">
Testimonials
</h2>
<div className="grid md:grid-cols-2 gap-8 mt-12">
{testimonials.map((item) => (
<div
key={item.name}
className="bg-white p-6 rounded-xl shadow">
<p>{item.text}</p>
<h4 className="mt-4 font-bold">{item.name}</h4>
</div>
))}
</div>
</div>
</section>
)
}

Step 7: CTA Section

components/CTA.jsx

export default function CTA() {
return (
<section id="cta" className="py-20 bg-blue-600 text-white">
<div className="text-center px-6">
<h2 className="text-4xl font-bold">Ready To Grow?</h2>
<p className="mt-4">Let's discuss your next project.</p>
<button className="mt-8 bg-white text-blue-600 px-8 py-3 rounded-lg">
Contact Us
</button>
</div>
</section>
);
}

Step 8: Main App Component

App.jsx

import Hero from './components/Hero';
import Features from './components/Features';
import About from './components/About';
import Testimonials from './components/Testimonials';
import CTA from './components/CTA';
function App() {
return (
<>
<Hero />
<Features />
<About />
<Testimonials />
<CTA />
</>
);
}
export default App;

Step 9: SEO Optimization

public/index.html

<title>
Modern Business Landing Page
</title>
<meta
name="description"
content="Professional business landing page built using React and Tailwind CSS."
/>
<meta
name="keywords"
content="React, Tailwind CSS, Landing Page"
/>

Use semantic tags:

<header>
<section>
<main>
<footer>

instead of unnecessary divs.

Step 10: Deploy to Vercel

Install:

npm install -g vercel

Build project:

npm run build

Deploy:

vercel

Follow prompts.

You will receive:

https://your-project.vercel.app

Performance Tips

Lazy Load Components

const Hero = React.lazy(() =>
import("./Hero")
);

Optimize Images

Use:

WebP
AVIF

formats whenever possible.

Reduce Bundle Size

Remove unused libraries.

Use Tailwind Utility Classes

Avoid large custom CSS files.

What Makes a Landing Page Convert Better?

A high-converting landing page should:

✅ Clear headline

✅ Strong value proposition

✅ Social proof

✅ Testimonials

✅ Mobile-friendly layout

✅ Fast loading speed

✅ Clear call-to-action

Final Result

After completing this tutorial, you’ll have:

  • Fully Responsive Landing Page
  • Mobile-First Design
  • Smooth Scrolling
  • Framer Motion Animations
  • SEO-Friendly Structure
  • Production Deployment on Vercel
  • Clean React Component Architecture

This foundation can be used for:

  • Agency Websites
  • Startup Landing Pages
  • SaaS Products
  • Consulting Businesses
  • Portfolio Websites
  • Marketing Campaigns


💡 Found this tutorial helpful? Please Subscribe, If this content is helpful to You. Happy Coding! 🚀

Fixing TS7016 Error in React: Could Not Find a Declaration File for Module react-router-dom

While working with a React + TypeScript project, you may suddenly see this error:

TS7016: Could not find a declaration file for module 'react-router-dom'

or:

implicitly has an 'any' type

This is a very common error when using TypeScript in React applications.

In this article, we’ll clearly understand:

  • What this error means
  • Why it happens
  • How to fix it
  • What are declaration files
  • Why TypeScript needs them
  • Best practices

The Exact Error

Your error looks like this:

TS7016: Could not find a declaration file for module 'react-router-dom'.'/node_modules/react-router-dom/index.js'implicitly has an 'any' type.

And this line causes the error:

import { NavLink } from 'react-router-dom';

What Does This Error Mean?

TypeScript is saying:

“I found the react-router-dom package, but I cannot find its type definitions.”

In simple words:

👉 TypeScript understands JavaScript code
❌ But it does NOT know the types of the package.


Why TypeScript Needs Types

TypeScript works using:

  • types
  • interfaces
  • definitions

Example:

let name: string = "Raju";

TypeScript knows:

  • name must be string

Similarly, TypeScript wants type information for external libraries too.


What Are Declaration Files?

Declaration files are:

.d.ts

files.

These files tell TypeScript:

  • what functions exist
  • what props exist
  • what return types exist

Example

Without types:

function add(a, b) {
return a + b;
}

TypeScript does not know:

  • what a is
  • what b is

With Types

function add(a: number, b: number): number {
return a + b;
}

Now TypeScript understands everything clearly.


Why This Error Happens

Usually because:

  • @types/react-router-dom package is missing
  • TypeScript cannot find declaration files
  • Package version mismatch
  • Incomplete installation

Most Common Fix

Install Type Definitions.

Run:

npm install --save-dev @types/react-router-dom

or

yarn add -D @types/react-router-dom

What This Package Does

This package provides:

type definitions

for:

react-router-dom

Now TypeScript can understand:

  • NavLink
  • Route
  • BrowserRouter
  • useNavigate
  • etc.

After Installation

Restart your React server:

npm start

or

npm run dev

Important Version Issue

This is VERY important.


⚠️ React Router v6+

If you are using:

react-router-dom v6 or later

then many times:

👉 type definitions are already included.

You may NOT need:

@types/react-router-dom

Then Why Error Happens?

Usually because:

  • corrupted node_modules
  • old TypeScript version
  • package mismatch
  • partial installation

Recommended Fix for React Router v6+

Delete:

node_modulespackage-lock.json

Then reinstall:

npm install

Check Installed Version

Run:

npm list react-router-dom

If Using React Router v5

Then install:

npm install --save-dev @types/react-router-dom

because v5 needs separate type definitions.


How TypeScript Reads Packages

When you import:

import { NavLink } from 'react-router-dom';

TypeScript searches for:

1. package2. type definitions3. .d.ts files

If type definitions are missing:

❌ TS7016 error occurs.


Temporary Quick Fix (Not Recommended)

You may see suggestions like:

declare module 'react-router-dom';

inside a .d.ts file.

This removes the error temporarily.

BUT:

❌ You lose type safety.


Why You Should Avoid This

Because TypeScript will treat everything as:

any

which defeats the purpose of TypeScript.


Best Solution

Always use proper type definitions.


❌ Before Fix

import { NavLink } from 'react-router-dom';

Error:

Could not find declaration file

✅ After Fix

npm install --save-dev @types/react-router-dom

Now error disappears.


Another Possible Issue

Sometimes developers accidentally install:

react-router

instead of:

react-router-dom

Make sure correct package exists.


Verify in package.json

"react-router-dom": "^6.x.x"

Recommended TypeScript Setup

Install:

npm install typescript @types/react @types/react-dom

Important Learning

JavaScript libraries work WITHOUT types.

But TypeScript applications need:

  • declarations
  • interfaces
  • type definitions

to provide:

  • autocomplete
  • validation
  • error checking
  • IntelliSense

Final Summary

✔ TS7016 means TypeScript cannot find type definitions
✔ Usually happens with missing @types/... packages
✔ Install correct type definitions
✔ Restart development server after installation
✔ React Router v6+ usually includes types already
✔ Version mismatch can also cause this error


Quick Fix Checklist

Before debugging deeply, check:

react-router-dom installed
✅ correct version installed
@types/react-router-dom installed (for v5)
✅ restart server
✅ delete node_modules and reinstall if needed


🚀 Call to Action

💡 Found this helpful? Subscribe for simple React and TypeScript debugging guides with real-world examples. Happy Coding!

Can We Use Both .js and .tsx Files in a React Project? (Complete Guide)

Many developers moving from JavaScript to TypeScript have this question:

🤔 “Can I use both .js and .tsx files in the same React project?”

The answer is:

✅ YES — absolutely.

In fact, many real-world React applications use a mix of:

  • .js
  • .jsx
  • .ts
  • .tsx

especially during migration from JavaScript to TypeScript.

In this guide, you’ll learn:

  • What .js and .tsx files are
  • Can they work together
  • Real-world usage
  • Benefits and drawbacks
  • Best practices

📌 Understanding File Types

Before understanding mixed usage, let’s quickly understand each file type.


🔹 What is .js?

.js means:

JavaScript file

Example:

function add(a, b) {
return a + b;
}

🔹 What is .tsx?

.tsx means:

TypeScript + JSX file

Used when:

  • Writing React components
  • Using TypeScript types

Example:

type Props = {
name: string;
};
function User({ name }: Props) {
return <h1>{name}</h1>;
}

Can They Work Together?

YES ✅

You can absolutely use:

  • .js
  • .jsx
  • .ts
  • .tsx

inside the same React project.


Real-World Scenario

Many companies:

  • Start project in JavaScript
  • Slowly migrate to TypeScript

So they temporarily have:

src/ ├── App.tsx ├── Header.jsx ├── utils.js ├── api.ts └── Dashboard.tsx

👉 This is completely normal.


How Does It Work?

When using TypeScript in React:

👉 TypeScript compiler can understand JavaScript files too.


Important Configuration

In tsconfig.json:

{
"compilerOptions": { "allowJs": true }
}

What Does allowJs Do?

"allowJs": true

👉 Allows TypeScript to compile .js files also.

Without this:

❌ TypeScript may ignore JS files.


Example Project Structure

Example

src/ ├── components/ │ ├── Button.tsx │ ├── Navbar.jsx │ ├── utils/ │ ├── math.js │ ├── api.ts │ └── App.tsx

👉 All these files can work together.


Importing Between JS and TSX


✅ Import JS into TSX

import add from "./utils/math";

✅ Import TSX Component

import Button from "./components/Button";

Why Developers Mix .js and .tsx


✅ 1. Gradual Migration

Big applications cannot migrate instantly.

So teams:

  • Convert slowly
  • File by file

✅ 2. Legacy Code Support

Old JavaScript files may still work perfectly.


✅ 3. Faster Development

Some utility files may remain simple .js.


Important Differences

Feature.js.tsx
Type Safety❌ No✅ Yes
IntelliSenseLimitedBetter
Compile Checks
React JSX Support

Benefits of Using .tsx

✅ Better Error Detection

TypeScript catches mistakes early.


✅ Strong Type Safety

type User = { name: string; };

✅ Better Developer Experience

  • Auto suggestions
  • Safer refactoring
  • Better maintainability

Problems You May Face

❌ 1. Type Errors with JS Files

Sometimes TypeScript cannot understand JS structure properly.


❌ 2. Inconsistent Codebase

Mixing too many styles may confuse developers.


❌ 3. Any-Type Problems

JS files may reduce type safety.


Best Practice (Recommended)

✅ Recommended Approach

If possible:

👉 Gradually move toward TypeScript


🚀 Good Strategy

Step 1

Keep old files in JS.


Step 2

Write new components in TSX.


Step 3

Slowly migrate old files.


Example Migration

Old JS Component

function Button(props) {
return <button>{props.title}</button>;
}

Migrated TSX Component

type Props = { title: string;};
function Button({ title }: Props) {
return <button>{title}</button>;
}

Important Note About .ts vs .tsx

ExtensionPurpose
.tsTypeScript without JSX
.tsxTypeScript with JSX

Interview Question

❓ Can we use .js and .tsx together in React?

👉 Answer:

Yes. React projects can use both JavaScript and TypeScript files together. TypeScript supports gradual migration using allowJs.


Final Summary

.js and .tsx can work together
✔ Common in real-world migration projects
✔ Use allowJs: true in TypeScript config
✔ TSX provides better type safety
✔ Gradual migration is best practice


💡 Found this helpful? Subscribe for simple React and TypeScript guides with real-world examples. Happy Coding!

React.memo and Composition in React (Complete Guide with Detailed Examples)

When building React applications, two concepts help developers create:

✅ Faster applications
✅ Cleaner code
✅ Reusable components
✅ Better maintainability

Those concepts are:

  • React.memo
  • Component Composition

In this guide, you’ll learn both concepts clearly with real-world examples.


What You Will Learn

✔ What is React.memo
✔ Why we need it
✔ How it improves performance
✔ What is Composition
✔ Why Composition is preferred in React
✔ Real-world examples for both


Part 1: Understanding React.memo

What is React.memo?

Simple Definition

React.memo is a higher-order component that prevents unnecessary re-rendering of functional components.


Why Do We Need React.memo?

In React:

👉 Parent component re-renders
➡ Child components also re-render

Even if:

  • Props did not change
  • UI did not change

This can reduce performance.


Example Without React.memo

❌ Code

import { useState } from "react";

function Child() {
console.log("Child Rendered");
return <h2>Child Component</h2>;
}

function App() {
const [count, setCount] = useState(0);
return (
<div>
<h1>{count}</h1>
<button onClick={() => setCount(count + 1)}>
Increment
</button>
<Child />
</div>
);
}

export default App;

What Happens Here?

Whenever count changes:

setCount(count + 1)

👉 Parent re-renders
👉 Child ALSO re-renders

Even though Child has no relation to count.


Optimized with React.memo

✅ Code

import { memo } from "react";

const Child = memo(function Child() {
console.log("Child Rendered");
return <h2>Child Component</h2>;
});

export default Child;

Now What Happens?

When parent re-renders:

👉 React compares previous props vs new props

If props are same:

✅ Child render is skipped


Important Rule

React.memo works best when:

✔ Props are stable
✔ Component renders frequently
✔ Rendering is expensive


⚠️ Example Where React.memo Fails

❌ Problem

<Child data={{ name: "React" }} />

Why?

Because:

{ name: "React" }

creates a NEW object every render.

👉 React thinks props changed.


Fix with useMemo

const data = useMemo(() => ({
name: "React"
}), []);

Real-World Example

Imagine:

  • Dashboard with charts
  • Huge tables
  • Complex UI

Without optimization:

❌ Unnecessary renders
❌ Slow UI

With React.memo:

✅ Better performance


When NOT to Use React.memo

Avoid if:

  • Component is very small
  • Props change frequently
  • Optimization not needed

👉 Overusing memo can increase complexity.


Interview Tip

❓ What is React.memo?

👉 Answer:

React.memo prevents unnecessary re-rendering of functional components by memoizing rendered output based on props comparison.


Part 2: Understanding Composition in React

📌 What is Composition?

Simple Definition

Composition means building complex UI using smaller reusable components.


Basic Composition Example

🔹 Button Component

function Button({ children }) {
return (
<button>
{children}
</button>
);
}

🔹 Usage

<Button>Save</Button>
<Button>Delete</Button>

Why Composition is Powerful

Composition helps:

✅ Reusability
✅ Cleaner architecture
✅ Scalability
✅ Separation of concerns


Composition with Layouts

Card Component

function Card({ children }) {
return (
<div className="card">
{children}
</div>
);
}

Usage

<Card>
<h2>React</h2>
<p>Composition Example</p>
</Card>

Composition Using Props

Modal Component

function Modal({ title, content, footer }) {
return (
<div className="modal">
<h2>{title}</h2>
<div>{content}</div>
<footer>{footer}</footer>
</div>
);
}

Usage

<Modal
title="Delete User"
content={<p>Are you sure?</p>}
footer={<button>Confirm</button>}
/>

Composition vs Inheritance

React documentation recommends:

✅ Composition
❌ Inheritance


Inheritance Problem

Inheritance creates:

  • Tight coupling
  • Complexity

Composition Advantage

Composition provides:

  • Flexibility
  • Better maintainability

Advanced Composition Pattern

Compound Components

Example:

<Tabs>
<Tabs.List />
<Tabs.Panel />
</Tabs>

Used in:

  • UI libraries
  • Design systems

Combining React.memo + Composition

This is common in real applications.

Example

const Card = memo(function Card({ children }) {
return (
<div className="card">
{children}
</div>
);
});

👉 Reusable + optimized


Common Mistakes

❌ Overusing React.memo

Not every component needs memoization.


❌ Creating Huge Components

Break UI into reusable pieces.


❌ Deep Prop Drilling

Use:

  • Context API
  • Composition patterns

Best Practices

✅ Use React.memo Carefully

Optimize only where needed.


✅ Prefer Composition

Build UI using reusable blocks.


✅ Keep Components Small

Small components:

  • Easier to test
  • Easier to reuse

Final Summary

React.memo

✔ Prevents unnecessary re-renders
✔ Improves performance
✔ Best for stable props


Composition

✔ Builds reusable UI
✔ Cleaner architecture
✔ Recommended React pattern


💡 Found this helpful? Subscribe for simple React guides, real-world examples, and interview preparation tips. Happy Coding!

Manipulating the DOM with useRef in React (Complete Guide with Examples)

When learning React, most developers use state and props to update the UI.

But sometimes, we need to directly access or manipulate a DOM element like:

  • Focusing an input
  • Playing a video
  • Scrolling to a section
  • Accessing element size

That’s where the useRef hook becomes very useful.

In this guide, you’ll learn:

  • What useRef is
  • Why we need it
  • How it manipulates the DOM
  • Best real-world examples
  • Common mistakes

What is useRef?

Simple Definition

useRef is a React hook that allows us to persist values and directly access DOM elements without re-rendering the component.


Syntax

const refName = useRef(initialValue);

How useRef Works

const inputRef = useRef(null);

React creates an object like:

{
current: null
}

When attached to an element:

<input ref={inputRef} />

inputRef.current now points to the actual DOM element.


Why Do We Need useRef?

Normally in React:

✅ UI updates through state

But sometimes we need:

  • Direct DOM access
  • Performance optimization
  • Persistent values without re-render

👉 useRef solves this.


Example 1: Focus Input Automatically

One of the most common use cases.

Code

import { useRef } from "react";

function App() {

const inputRef = useRef(null);

const focusInput = () => {
inputRef.current.focus();
};

return (
<div>
<input ref={inputRef} type="text" />
<button onClick={focusInput}>
Focus Input
</button>
</div>
);
}

export default App;

How It Works ?

Step 1

const inputRef = useRef(null);

Creates reference object.


Step 2

<input ref={inputRef} />

Connects DOM element to ref.


Step 3

inputRef.current.focus();

Directly accesses DOM element and focuses input.


Example 2: Change Background Color

Code

import { useRef } from "react";

function App() {

const boxRef = useRef(null);

const changeColor = () => {
boxRef.current.style.backgroundColor = "blue";
};

return (
<div>
<div
ref={boxRef}
style={{
width: "200px",
height: "200px",
background: "gray"
}}
/>
<button onClick={changeColor}>
Change Color
</button>
</div>
);
}

Example 3: Auto Scroll to Section

Very useful in landing pages.

Code

import { useRef } from "react";

function App() {

const sectionRef = useRef(null);

const scrollToSection = () => {
sectionRef.current.scrollIntoView({
behavior: "smooth"
});
};

return (
<div>
<button onClick={scrollToSection}>
Go to Section
</button>
<div style={{ height: "100vh" }} />
<div ref={sectionRef}>
Target Section
</div>
</div>
);
}

Example 4: Video Play/Pause Control

Code

import { useRef } from "react";

function App() {

const videoRef = useRef(null);

return (
<div>
<video
ref={videoRef}
width="400"
src="video.mp4"
/>
<button onClick={() => videoRef.current.play()}>
Play
</button>
<button onClick={() => videoRef.current.pause()}>
Pause
</button>
</div>
);
}

Example 5: Store Previous Value Without Re-render

Code

import { useEffect, useRef, useState } from "react";

function App() {
const [count, setCount] = useState(0);
const previousCount = useRef(0);

useEffect(() => {
previousCount.current = count;
}, [count]);

return (
<div>
<h2>Current: {count}</h2>
<h2>Previous: {previousCount.current}</h2>
<button onClick={() => setCount(count + 1)}>
Increment
</button>
</div>
);
}

Important Difference: useRef vs useState

FeatureuseRefuseState
Causes re-render❌ No✅ Yes
Stores value✅ Yes✅ Yes
Access DOM✅ Yes❌ No

Best Use Cases of useRef

Use useRef for:

✅ DOM access
✅ Focus management
✅ Scroll handling
✅ Timers
✅ Storing mutable values


Common Mistakes

❌ Manipulating DOM Too Much

React prefers declarative UI.

👉 Don’t overuse direct DOM manipulation.


❌ Accessing .current Before Render

console.log(ref.current);

May be null initially.


❌ Using useRef Instead of State

If UI must update → use state.


Interview Question

❓ What is useRef in React?

👉 Answer:

useRef is a hook used to persist values across renders and directly access DOM elements without causing re-renders.


Final Summary

  • useRef gives direct DOM access
  • Does not trigger re-render
  • Useful for focus, scroll, video control, timers
  • Should be used carefully

💡 Found this helpful? Subscribe for simple React guides, real-world examples, and interview preparation tips. Happy Coding!