📸 A quick React lesson I learned while working on a project! I was building a small React app and added an “images” folder inside the src directory to store some pictures. Everything looked fine — until I tried to display them in my components. No matter what path I used, the images just wouldn’t load! 😅 After some digging, I realized that React doesn’t serve static assets directly from the src folder — it only compiles JavaScript code from there. The correct approach was to move my images folder to the public directory. ✅ Here’s what worked: <img src="/images/profile.png" alt="Profile" /> 💡 Lesson learned: Always keep your static files (like images, icons, or PDFs) in the public folder if you want to access them directly using a path. React’s build process doesn’t include files from src unless they’re imported in JS. It was a small issue, but it helped me understand how React’s build structure actually works. Every bug teaches something new — this one taught me about static asset handling! 🚀 #ReactJS #WebDevelopment #FrontendDeveloper #MERNStack #LearningByDoing #CodingJourney #JavaScript
Moved images folder to public directory to load in React app
More Relevant Posts
-
⚛️ Day 1 of my React Series — Let’s start with Components Ever wondered what a React component really is? It’s simpler than it sounds 👇 A React Component is just a JavaScript function that returns markup. But here’s the twist — it doesn’t return HTML, it returns JSX! JSX looks like HTML but works like JavaScript — that’s what makes React so powerful and declarative. 💡 In simple words: Think of components as LEGO blocks — reusable pieces that combine to build entire UIs. 🧩 One component for a button, one for a card, one for a navbar — and together, they make your app. #React #JavaScript #FrontendDevelopment #WebDevelopment #Learning #ReactJS #Frontend #Coding
To view or add a comment, sign in
-
-
⚛️ When I first heard about React, I thought it was just another JavaScript library. But once I actually used it — I understood why it’s everywhere. React isn’t just popular because it’s “cool” — it’s popular because it makes sense. It lets you build powerful, dynamic UIs fast, and once you understand components, props, and state… you start seeing how everything connects like a system. For beginners, it can feel overwhelming at first — JSX, hooks, routing — but the moment your first app actually reacts to user actions, that spark hits. ⚡ What makes React special is not just how it looks, but how it teaches you to think like a developer. You stop writing code randomly and start organizing logic, structure, and design together. If you’re learning web development, React is one of those tools that opens a whole new world — but only if you practice building real things, not just following tutorials. Because the best way to “learn React” isn’t by watching someone else code… It’s by debugging your own mistakes and making your first project come alive on the screen. 💻 #React #WebDevelopment #Frontend #FullStack #Coding #Developers #JavaScript #Learning #Motivation
To view or add a comment, sign in
-
𝑾𝒉𝒂𝒕’𝒔 𝒐𝒏𝒆 𝑹𝒆𝒂𝒄𝒕 𝒎𝒊𝒔𝒕𝒂𝒌𝒆 𝒚𝒐𝒖’𝒍𝒍 𝒏𝒆𝒗𝒆𝒓 𝒓𝒆𝒑𝒆𝒂𝒕? For me, it’s starting a React project without setting up all the essential modules and libraries first. There were times I got so eager to jump straight into development that I skipped proper planning and foundational setups, things like Redux, TailwindCSS, React Router, favicon, and metadata. At first, it felt fine. I’d just say, “I’ll add them later.” But “later” always came at the worst time, right when I was in the middle of building components or testing pages. Then I’d suddenly realize something important wasn’t configured yet, and I’d have to pause development to fix it. That constant back-and-forth was frustrating and slowed my entire workflow. Now, before I write a single line of UI code, I ensure every core dependency and config is properly set up. It saves me hours of debugging, keeps my project structure clean, and lets me focus on what truly matters, building smooth, scalable features. As a Developer, I’ve learned that a few minutes of setup discipline upfront can save you endless stress down the road. I’m curious, what’s one React mistake you’ve made that you’ll never repeat? You can check out some of my recent React builds and experiments on my GitHub: https://lnkd.in/eP9nmTEw. #ReactJS #FullstackDevelopment #WebDevelopment #FrontendDeveloper #JavaScript #CodingJourney #RemoteDeveloper #SoftwareEngineering #ReactTips #CleanCode
To view or add a comment, sign in
-
-
Hello everyone!!! ✅one of the most essential topics in React JS — Components . 🚀 A Component in React is like a small, reusable piece of UI that we can use multiple times in our project. It helps to make our application more organized, reusable, and scalable ⚡ ✅ Here's what I explored today: 🔹 What are Components and why they are the heart of React JS ⚛️ 🔹 Types of Components in React: 👉 Functional Components — simple and easy to write using functions. 🔹 How to create, export, and import components inside a React jsx 🌐 🔹 How to pass data using props and reuse components efficiently 🔁 🔹 Understanding how components communicate and render dynamically . ➡️Eg:-practiced: I created a simple functional components and return , render it inside the browser localhost: 5173 component. ➡️ It was amazing to see in the 🌐browser app components,name , number, hello world see this video. #ReactJS #Components #FrontendDevelopment #LearningJourney #WebDevelopment #JavaScript #Coding #DeveloperCommunity #10000Coders
To view or add a comment, sign in
-
Let's talk about React fundamentals. I often see developers get tangled in the 'why' of React. Why the V-DOM? What’s the real difference between props and state? Why is it 'declarative'? To help clear the confusion, I’ve created a 14-page, no-fluff guide that breaks down the core concepts of Modern React. This is the roadmap I use to explain the fundamentals to my team or when mentoring. No one should have to "fear to ask." Inside the PDF, I've broken down: ✅ The "Smart LEGO" analogy to finally make components click. ✅ The "Blueprint" model (Declarative vs. Imperative). ✅ A map of the modern ecosystem (Next.js, Vite, etc.). ✅ My complete VS Code toolkit & dev environment setup. My goal is to give back and help make these powerful concepts accessible to everyone, whether you're a beginner or just need a refresher. 📖 Swipe through the full PDF and let me know: What's one React concept you wish someone had explained to you more simply when you first started? #react #reactjs #javascript #frontenddevelopment #webdevelopment #softwareengineering #programming #techtips #uidevelopment #nextjs #wordpressdeveloper
To view or add a comment, sign in
-
⚛️ A small React “props” moment I’ll never forget! I was building a simple Profile component that needed to display a user’s name and role. I passed the props from the parent and expected it to just work — but nothing appeared on the screen. 😅 After checking my code multiple times, I realized I had forgotten the most important part — actually using the props inside the component! ❌ Wrong: function Profile() { return <h2>{name}</h2>; } ✅ Correct: function Profile(props) { return <h2>{props.name}</h2>; } That’s when it clicked — props are like packages 📦 that the parent sends to the child. If you don’t open (use) them properly, the child has no idea what’s inside! 💡 Lesson learned: Props make React components reusable and dynamic — but only if you remember to “unwrap” them first. 😉 Every tiny bug in React is a small reminder to pay attention to the details — because that’s where the learning happens. 🚀 #ReactJS #WebDevelopment #FrontendDeveloper #MERNStack #Props #CodingJourney #LearningByDoing
To view or add a comment, sign in
-
🚨 The error every React beginner faces (and secretly panics about 😅) If you’ve ever seen this message: “Adjacent JSX elements must be wrapped in an enclosing tag.” you’re not alone — almost everyone breaks their code on this one the first time! When I was learning React, I couldn’t figure out why adding just one more div could crash my whole app 😭 But then I discovered the golden rule 👇 👉 Every React component’s return() must have only ONE parent element. That’s it — one simple rule that saves you from hours of debugging! You can fix it easily by: 🟩 Wrapping everything in one <div> or 🟨 Using a <></> fragment (if you don’t want an extra tag in your HTML) These small things make you a cleaner, smarter, and more confident React developer 💪 💬 Have you ever faced this React error before? How did you first fix it — by trial and error or by searching on Google at 2 AM? 😄 Share your experience in the comments 👇 #ReactJS #WebDevelopment #FrontendDeveloper #JavaScript #CodingTips #LearnReact #WomenInTech #SoftwareEngineering #DeveloperCommunity
To view or add a comment, sign in
-
-
Vue.js is a powerful framework for crafting interactive user interfaces and single-page applications. I found it interesting that its design allows developers to start with minimal complexity and scale to advanced features. This flexibility makes it an excellent choice for both beginners and experienced developers. How have you leveraged Vue.js in your projects, or what frameworks do you prefer? Read more here: https://lnkd.in/dtWWWs82
To view or add a comment, sign in
-
Tayo loved React. He could build components, handle state, and spin up projects in no time. So when he started learning Next.js, he thought it’d be a smooth ride. But soon, things got messy. His app was rendering weirdly. Some data showed up instantly, other times it didn’t. Pages loaded fine locally, but once deployed - chaos. He spent nights debugging, rewriting code, and watching tutorials. Still… nothing made sense. Until one day, his mentor smiled and said, “Tayo, you’re not lost. You are just mixing up where things happen.” And that one line changed everything. Tayo finally understood the heart of Next.js: It’s not just React with pages, it’s React with power. Next.js decides what runs on the server and what runs on the client. When you get that, everything else starts making sense. The confusion wasn’t about the framework, it was about not understanding server-side rendering (SSR) and client-side rendering (CSR). He realised: Some code runs before the user ever sees the page (SSR) Some code runs after (CSR) And knowing when and why makes you unstoppable From that moment, Tayo stopped treating Next.js like a stranger and started using it like an ally. He didn’t just fix his bugs, he gained a new perspective: in code and in life. You can’t control everything. But you can always learn where things really happen. What’s one thing about Next.js that confused you the most when you first started? Share it below, your insight might save someone hours of struggle. #NextJS #ReactJS #WebDevelopment #FrontendDevelopment #FullStackDeveloper #SoftwareEngineering #ServerSideRendering #ClientSideRendering #JavaScript #LearningInPublic #BuildInPublic
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