🚀 Built a React App Using useReducer ⚛️ I recently built a "React Quiz" app to strengthen my understanding of state management in React. 🧠 Key learnings: Managing complex state with useReducer Handling async data (loading questions from a mock API) Managing loading, error, and ready states ⚡ Answer selection & smooth navigation between questions Tracking progress 📊 Completing & restarting the quiz 🔁 Implementing a countdown timer using useEffect ⏱️ 💡 This project helped me understand when to use useReducer over useState for more structured and scalable state logic. 🔗 GitHub Repo: https://lnkd.in/g8VeyXhi Feedback is welcome 🙌 #React #JavaScript #FrontendDevelopment #WebDevelopment #ReactJS #LearningByBuilding
More Relevant Posts
-
Redux Thunk — and it actually changed how I think about async in React apps. Before today, I was confused about one thing: Redux reducers are pure functions. So how do you handle async operations like API calls inside them? The answer? You don't. That's where Redux Thunk comes in. Redux Thunk is a middleware that lets you write action creators that return a function instead of a plain object. That function receives dispatch and getState, so you can: → Dispatch multiple actions in sequence → Wait for async operations (like fetch calls) to resolve → Conditionally dispatch based on current state It sits between the action and the reducer — giving you a place to do async work before the reducer ever sees the result. The mental model that clicked for me: a "thunk" is just a function that does something later. Instead of dispatching an action immediately, you dispatch a function that dispatches the action when it's ready. Still getting comfortable with it, but it's one of those concepts that makes a lot of other things suddenly make sense. What patterns do you use for async state management in React? Redux Thunk, RTK Query, Zustand, something else? Drop your thoughts below 👇 #Redux #ReduxThunk #ReactJS #JavaScript #TIL #WebDevelopment
To view or add a comment, sign in
-
I used to think I understood React… until I had to pass the same state through 3–4 components just to control one small thing 😅 It worked, but it didn’t feel right. So instead of jumping to another tutorial, I tried to actually "understand the problem" and that led me to the Context API. To keep things simple, I built a tiny “bulb toggle” app 💡 At first, everything was prop-based. Then I switched to Context… and the difference was obvious. Now: 1. I’m not passing props through unnecessary layers 2. Components feel more independent 3. The code is easier to read and reason about But I also learned something important while doing this: 👉 Context is helpful, but it’s not a replacement for everything If the state is simple and only needed in a few places, props are still totally fine. Context starts to make sense when multiple parts of your app need the same data. Still early in my journey, but this was one of those small moments where things started to click. If you’ve worked with Context before -> 👉 how do you decide between props, Context, or other state tools? #learninginpublic #reactjs #webdevelopment #javascript #frontenddevelopment
To view or add a comment, sign in
-
-
🗂️ Does your app load 10,000 items at once? That's a performance disaster waiting to happen. Learn how pagination works, why it matters, and build a real React component from scratch — step by step. 🚀 Full guide is live on hamidrazadev.com — link in bio! #webdev #reactjs #javascript #frontenddevelopment #programminglife #developerlife #hamidrazadev
To view or add a comment, sign in
-
-
⚡ React Performance Optimization Tip Your React app is slow? This might be the reason 👇 Unnecessary re-renders. Solution → React.memo const Child = React.memo(({data}) => { console.log("render") return {data} }) Now component only re-renders when props change. 💡 Use when: • Large list rendering • Heavy components • Performance issues Small optimization → Big performance gain 🚀 I'm sharing daily React tips while preparing for new opportunities. Follow for more React learning. #reactjs #performance #frontenddeveloper #mernstack #javascript
To view or add a comment, sign in
-
🚀 Day 3: Project Structure in React Now that the app is set up, it’s time to understand how everything is organized. Today is all about exploring the React project structure and knowing where things live. 💡 **What I learned:** • `src/` – Main source code • `App.jsx` – Root component • `main.jsx` – Entry point of the app • `public/` – Static files • `package.json` – Project dependencies & scripts ⚡ **Why it matters:** A clear understanding of project structure helps in writing clean, scalable, and maintainable code. 🧠 **Takeaway:** Before building complex features, know your folder structure — it saves a lot of time later. #30DaysOfReact #Day3 #ReactJS #FrontendDeveloper #JavaScript #WebDevelopment
To view or add a comment, sign in
-
-
🚀 Just built a Notes App using React! A simple yet powerful app to create, manage, and organize notes efficiently. This project helped me strengthen my frontend skills and understand real-world component structuring. 🔗 Check it out here: https://lnkd.in/gb38XjAK Would love your feedback and suggestions! 💬 #ReactJS #WebDevelopment #FrontendDevelopment #JavaScript #Coding #Projects #DeveloperJourney
To view or add a comment, sign in
-
🚀 Most people think slow apps = slow internet ❌ But today I learned something deeper 👇 A React app is not just “download and show UI” The browser actually does 3 heavy things: 📥 Download JavaScript 🧠 Parse (understand) it ⚙️ Execute (run) it 👉 Even UNUSED code still gets parsed 👉 Some of it even executes 💥 That means: Big bundle = more browser work = slower app So performance is not just about: 👉 reducing size It is about: 👉 reducing unnecessary JavaScript work That’s where things like: ⚡ Code Splitting 💤 Lazy Loading 🌳 Tree Shaking actually matter 💡 Biggest mindset shift: “Don’t send everything. Send only what the user needs right now.” Learning in public 🚀 #frontend #react #webperformance #javascript #softwareengineering
To view or add a comment, sign in
-
🚀 Faced a tricky routing issue while moving from React.js to Next.js — and finally solved it. In React Router, getting dynamic params like: 👉 category 👉 subcategory 👉 brand was super straightforward. But in Next.js App Router, I was only getting: 👉 slug 👉 dynamicRoute This completely broke my product filtering logic. ⚠️ Problem: My API calls were no longer matching the correct category, subcategory, or brand. ✅ What I did: Re-structured route handling logic Normalized params from slug + dynamicRoute Built dynamic API endpoint mapping Optimized fetch calls (no unnecessary re-fetch) 💡 Key Learning: Next.js routing is powerful, but you must rethink how params are handled compared to React Router. 🎥 I made a short video explaining the problem and solution step by step. 🔗 Watch here: https://lnkd.in/gA4zGUFA 💻 Projects: https://lnkd.in/g-jJRjV2 #NextJS #ReactJS #WebDevelopment #Frontend #FullStack #JavaScript #Debugging #MERN #Developers #LearningInPublic
To view or add a comment, sign in
-
🧠 Most React apps scale fine at the start, Until state becomes messy, unpredictable, and hard to manage. 👉 Read the full guide 🔗 📌 What you’ll learn: https://shorturl.at/jtKRp ➥ Why poor state design is the biggest bottleneck in scaling React apps ➥ How to separate UI state vs server state effectively ➥ When to use local state, context or state libraries ➥ Patterns to avoid prop drilling and unnecessary re-renders ➥ Practical strategies to build clean, scalable state systems ✨✍ Written by: Harsh Chauhan #ReactJS #StateManagement #FrontendArchitecture #WebDevelopment #JavaScript #ScalableSystems #Engineering
To view or add a comment, sign in
-
-
⚛️ Learning React Hooks - useState I recently explored one of the core concepts of React — Hooks (useState) — and applied it by building a simple Counter App. Here’s what I implemented: ✔️ Managed state using useState ✔️ Built increment & decrement functionality ✔️ Added boundary conditions (0 to 20 limit) ✔️ Understood how React re-renders on state updates Code snippet: let [counter, setCounter] = useState(0); const addValue = () => { setCounter(counter + 1); }; const removeValue = () => { setCounter(counter - 1); }; 💡 This project helped me clearly understand how state works in React and why hooks are so powerful for building interactive UIs. #ReactJS #JavaScript #WebDevelopment #FrontendDevelopment #ReactHooks #LearningInPublic
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