Yesterday I shared React tips for beginners. Today, here are 5 mistakes almost every React beginner makes 👇 1. Using array index as key Bad: `key={index}` Better: Use a unique id. 2. Changing state directly Wrong: `user.name = "John"` Always use: `setUser({...user, name: "John"})` 3. Forgetting dependency array in useEffect Without it, your effect may run again and again unexpectedly. 4. Creating one huge component Break your UI into smaller reusable components. 5. Passing too many props everywhere If data is shared across many components, use Context API or state management. I made all of these mistakes while learning React 😅 But once I fixed them, React became much easier. Which mistake have you made the most? #reactjs #javascript #frontend #webdevelopment #coding
Durgesh Yadav’s Post
More Relevant Posts
-
🚀 Understanding Hooks in React (Simple Explanation) When I first started learning React, I thought state management was only possible with class components… but then I discovered Hooks — and everything changed. 👉 Hooks are special functions in React that allow functional components to use features like state and lifecycle methods. 💡 Example: With useState, we can easily manage state inside a function component — no need for classes anymore. Why Hooks are powerful: ✔ Cleaner and more readable code ✔ Reusable logic across components ✔ Less boilerplate compared to class components ✔ Makes development faster and more scalable Some commonly used Hooks: 🔹 useState – manage state 🔹 useEffect – handle side effects (API calls, timers) 🔹 useRef – access DOM elements 🔥 One simple line: Hooks = extra powers for functional components. Learning Hooks really changed how I write React code — and made development feel much more intuitive. #ReactJS #WebDevelopment #Frontend #JavaScript #LearningInPublic #Developers
To view or add a comment, sign in
-
-
⚠️ React Hooks Look Simple… Until You Try Them. As I’ve been learning useState, I started noticing something…” At first, it looked easy. Just a variable… and a function to update it. Simple, right? That’s what I thought. Until I actually tried using it. Coming from JavaScript, I’m used to changing values directly. But in React? You don’t just change values. You update state… and React re-renders everything for you. That shift? Confusing at first. I found myself asking: “Why can’t I just update it directly?” 🤔 But as I kept practicing, something started to click. React isn’t just about writing code. It’s about thinking differently. Instead of controlling everything manually, you describe what should happen… And React handles the rest. That’s powerful. Still learning. Still making mistakes. But now it’s starting to make sense. 💬 If you’ve learned React hooks — what confused you the most at the beginning? #ReactJS #FrontendDevelopment #JavaScriptDeveloper #WebDevelopmentJourney #LearnToCode
To view or add a comment, sign in
-
Day 12–13 of my 30 Days Job-Ready Challenge Built a Todo App in React. It looks simple, but learned a lot while building it: Why we should not mutate state directly Difference between map() and filter() and where to use them Event bubbling (delete click was marking task complete 😅) Using localStorage to persist data The main learning was not coding. It was thinking before writing code. What state is needed? What should be its type? What happens on different user actions? Clear logic >>> writing code fast. Discipline builds consistency. #100DaysOfCode #ReactJS #Frontend #WebDevelopment #JavaScript #LearningInPublic
To view or add a comment, sign in
-
⚛️ React State Hooks — Explained Simply While learning React, I realized one thing: 👉 Not every hook is used daily. Here are the most important ones you actually need to know: 🔹 useState → for basic state (forms, counters) 🔹 useEffect → for API calls & side effects 🔹 useRef → access DOM without re-render 🔹 useContext → share global data 🔹 useReducer → handle complex state logic 🔹 useMemo & useCallback → optimize performance 💡 My takeaway: 80% of your work is done with just useState + useEffect Other hooks become useful as your app grows I’ve summarized everything in this infographic 👇 Which React hook do you use the most? #reactjs #javascript #frontend #webdevelopment #coding
To view or add a comment, sign in
-
-
📘 Mastering React JS Fundamentals & Core Concepts Continuously strengthening my front-end development skills, I’ve been diving deep into React JS fundamentals and organizing key concepts in a structured way. This learning covers: 🔹 React basics and component-based architecture 🔹 Understanding JSX and how it works behind the scenes 🔹 Difference between State vs Props and their roles in data handling 🔹 Hands-on practice with Hooks like `useState` and `useEffect` 🔹 React lifecycle and how components update efficiently using the Virtual DOM Building a strong foundation in these core concepts is essential for developing scalable and high-performance web applications. 🚀 Always learning, always improving. #ReactJS #WebDevelopment #FrontendDevelopment #JavaScript #CodingJourney #SoftwareDevelopment
To view or add a comment, sign in
-
-
Props vs State in React Most beginners get confused between Props and State in React. At first, both seem similar because both store data. But the real difference is simple: * Props = Data received from another component * State = Data managed inside the component Example: function Parent() { return <Child name="Durgesh" />; } function Child(props) { return <h1>{props.name}</h1>; } Here, `name` is a prop because it comes from the Parent component. Now look at State: const [count, setCount] = useState(0); Here, `count` is managed inside the same component. Quick Difference 👇 • Props are read-only • State can be updated • Props come from parent to child • State belongs to the component itself Think like this: Props = Things you receive State = Things you control Once you understand this difference, React becomes much easier. What confused you more when learning React — Props or State? #react #javascript #frontend #webdevelopment #reactjs #coding
To view or add a comment, sign in
-
-
While learning React, I made a mistake that slowed me down… I used useEffect for everything. Fetching data Updating state Even simple calculations At first, it felt powerful. But soon my code became: Confusing Hard to debug Full of unnecessary logic Then I realized something important: 👉 Not everything belongs in useEffect Now I: • Keep logic simple • Avoid unnecessary state • Use hooks only when needed The biggest lesson: Clean code > clever code Curious to know: What confused you most while learning React? #ReactJS #FrontendDeveloper #WebDevelopment #JavaScript
To view or add a comment, sign in
-
I wasted months trying to learn React. Not because React is hard… But because my JavaScript was weak. ↓ Everyone wants to jump into React: Hooks. APIs. Projects. It looks exciting. But here’s what most beginners don’t realize: React is just JavaScript under the hood. If your JS isn’t strong, React will feel confusing. ↓ What I was missing: → Functions and arrow functions → Arrays and objects → Destructuring → ES6 concepts → Async JavaScript (Promises, async/await) I was copying code……but not understanding it. ↓ Everything changed when I stopped chasing frameworks… …and fixed my fundamentals. Suddenly: → Components started making sense → State was no longer “magic” → Debugging became easier ↓ If you’re learning frontend right now: Don’t make this mistake. Skip the hype. Build your foundation first. ↓ Smart way to learn: → Focus on core JavaScript → Solve small logic problems → Then move to React This is how you go from: “copying code” to “building real applications” ↓ Most developers won’t do this. That’s why most stay stuck. ↓ I’ll be sharing a complete React roadmap step by step. ⇒ Visit My Portfolio: 👉 https://lnkd.in/defxD37a Next → Components, Props, and how React actually works ↓ Where are you stuck right now in React or JavaScript? Drop it below. I’ll help 👇 #ReactJS #JavaScript #WebDevelopment #FrontendDeveloper #LearnToCode #CodingJourney #DeveloperCommunity #TechGrowth
To view or add a comment, sign in
-
-
🔹 React Basics: Props vs State (Explained Simply) When starting with React, one of the most important concepts to understand is the difference between Props and State. Here’s a simple breakdown 👇 👉 Props (Properties) • Passed from parent to child components • Read-only (cannot be modified) • Used to make components reusable 👉 State • Managed within the component • Can be updated using hooks like `useState` • Controls dynamic data and UI behavior 💡 In short: Props help you pass data, while State helps you manage data. Understanding this difference is key to building scalable and maintainable React applications. If you're learning React, mastering these fundamentals will make your journey much smoother 🚀 💬 What topic should I cover next in React? #ReactJS #FrontendDevelopment #JavaScript #WebDevelopment #LearningInPublic #SoftwareDevelopment #CodingJourney #Developers
To view or add a comment, sign in
-
-
React Hooks changed the way I write React forever. 🎣 Before hooks, I was juggling class components, lifecycle methods, and `this` bindings just to manage basic state. Then `useState` and `useEffect` walked in and said "relax, we got you." 😄 A few things I love about hooks: → `useState` — dead simple state management, no class needed → `useEffect` — handle side effects cleanly in one place → `useCallback` & `useMemo` — performance wins without the headache → Custom hooks — extract and reuse logic like a pro The best part? Your components become smaller, more readable, and actually fun to write. If you're still on class components, I genuinely encourage you to make the switch. The learning curve is worth it — I promise. 🙌 What's your favourite hook? Drop it in the comments! 👇 #ReactJS #React #WebDevelopment #Frontend #JavaScript #ReactHooks #Programming #SoftwareEngineering
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Learn , build, ship...