🚀 Just built and pushed my 2nd React + TypeScript projects to GitHub! I know Todo apps get a lot of hate — "It's just a todo app, bro." 😅 But here's what building this actually taught me 👇 𝗪𝗵𝗮𝘁 𝗜 𝗯𝘂𝗶𝗹𝘁: ✅ Add tasks with the Enter key or button click 🗑️ Delete individual tasks 💣 Clear all tasks at once ⚠️ Input validation — no empty tasks allowed 🎨 Clean dark UI with Tailwind CSS 𝗧𝗲𝗰𝗵 𝗦𝘁𝗮𝗰𝗸: ⚛️ React 18 🔷 TypeScript 🎨 Tailwind CSS ⚡ Vite 𝗪𝗵𝗮𝘁 𝗜 𝗮𝗰𝘁𝘂𝗮𝗹𝗹𝘆 𝗹𝗲𝗮𝗿𝗻𝗲𝗱: → useState with TypeScript generics const [todo, setTodo] = useState<Todo[]>([]) → Interface definitions for type safety interface Todo { id, text, completed } → Array methods for state updates filter() for delete, spread for add → Controlled inputs in React value + onChange pattern → Conditional rendering showing an empty state when no tasks The biggest realization? Every "simple" project teaches you something real. TypeScript caught my bugs BEFORE they happened. That's the whole point. 🎯 This is Day 2 of building in public. More projects incoming. 👀 GitHub: https://lnkd.in/gEkQNkmK Live Link: https://lnkd.in/g7i2ZxjA Are you also learning React? Drop a 👋 below — let's connect! #React #TypeScript #WebDevelopment #Frontend #100DaysOfCode #JavaScript #TailwindCSS #BuildInPublic #Developer #Coding
Building React Todo App with TypeScript and Tailwind CSS
More Relevant Posts
-
I used to think React.ReactNode and React.ReactElement were the same thing… They are NOT. And this mistake silently breaks a lot of beginner code Here’s the simplest way I now understand it: *React.ReactNode = anything React can render *React.ReactElement = only JSX elements Sounds small, but watch this If you write: children: React.ReactElement You just blocked this: <Container>Hello</Container> Because "Hello" is NOT a ReactElement. But when you use: children: React.ReactNode Now everything works: ✅ Text ✅ Components ✅ Elements ✅ Even null When to use : ✅ Use React.ReactNode when: * You’re typing children * You want flexibility * You don’t care what gets rendered, as long as React can display it Avoid React.ReactNode when: * You need strict control over what is passed ✅ Use React.ReactElement when: * You want ONLY JSX/components * You’re enforcing structure (e.g. design systems, wrappers) *Avoid React.ReactElement when: * You expect text, numbers, or mixed content What I learned today: TypeScript isn’t just about types… It’s about preventing subtle bugs before they happen I’m currently learning React + TypeScript and sharing what I discover daily. If you’re on the same journey, let’s connect 🤝 #typescript #reactjs #frontenddeveloper #webdevelopment #codingjourney #javascript #buildinpublic #devcommunity #learninpublic
To view or add a comment, sign in
-
-
💡 5 TypeScript Tricks That Made My React Code Cleaner As a developer, I’ve always believed that small improvements lead to big impact. Recently, I started using TypeScript more effectively in my React projects—and the difference is 🔥 Here are 5 simple but powerful tricks that helped me write cleaner, safer, and more maintainable code: ✅ 1. Use Props Interfaces Instead of Inline Types Defining props separately improves readability and reusability. interface ButtonProps { label: string; onClick: () => void; } const Button = ({ label, onClick }: ButtonProps) => ( <button onClick={onClick}>{label}</button> ); ✅ 2. Leverage Partial<T> for Flexible State Updates Perfect for forms or optional updates. type User = { name: string; age: number; }; const updateUser = (user: Partial<User>) => { // update logic }; ✅ 3. Use as const for Safer Constants Avoid unexpected type widening. const roles = ["admin", "user", "guest"] as const; type Role = typeof roles[number]; ✅ 4. Create Reusable Utility Types Avoid repetition and keep things DRY. type Nullable<T> = T | null; ✅ 5. Strongly Type useRef and useState No more guessing what’s inside. const inputRef = useRef<HTMLInputElement>(null); const [count, setCount] = useState<number>(0); ✨ Final Thought: TypeScript is not just about avoiding errors—it’s about writing intentional, self-documenting code. If you’re using React and not fully leveraging TypeScript yet, you’re leaving a lot of clarity on the table. 👉 What’s your favorite TypeScript trick? #TypeScript #ReactJS #WebDevelopment #Frontend #CleanCode #SoftwareEngineering
To view or add a comment, sign in
-
I just learned something small in TypeScript today… but it completely changed how I think about handling user state in React Instead of guessing if a user exists or not, I used a proper type: • AuthUser | null That one line made everything safer and cleaner. • No more “undefined errors” flying around. • No more messy checks. • Just clear, predictable state. I built a simple login/logout flow where: • The user is either an object (logged in) • Or null (logged out) And with optional chaining (user?.name), my UI stays smooth without breaking. It may look basic… but this is how solid frontend systems are built one correct type at a time. TypeScript is slowly turning my “it works” code into “it’s reliable” code If you’re learning React + TypeScript, don’t skip this pattern. It’s a game changer. I’m currently deep in my TypeScript journey, sharing what I learn as I grow. Let’s connect 🤝 #typescript #reactjs #frontenddeveloper #webdevelopment #codingjourney #javascript #techinpublic #buildinpublic #devcommunity
To view or add a comment, sign in
-
-
🚀 Why TypeScript is Important in React & Next.js Building apps with React & Next.js is powerful… But as your project grows, managing code becomes challenging 👇 That’s where TypeScript changes the game 💡 🧩 1. Catch Errors Early 👉 TypeScript finds bugs during development ✔ Reduces runtime errors ✔ Saves debugging time ⚡ 2. Better Developer Experience 👉 Smart autocomplete & IntelliSense ✔ Faster coding ✔ Less confusion in large codebases 🧱 3. Scalable Applications 👉 Strong typing keeps code structured ✔ Easy to manage large projects ✔ Improves readability & maintainability 🔁 4. Easier Refactoring 👉 Modify code confidently ✔ Type safety prevents breaking changes ✔ Ideal for long-term projects ⚡ Key Benefits ✔ Fewer production bugs ✔ Cleaner & maintainable code ✔ Better collaboration in teams ✔ Production-ready applications 🧠 When should you use it? 👉 Small apps → Optional 👉 Medium/Large apps → Highly recommended 👉 Team projects → Must-have 🔥 Reality Check: Most modern React & Next.js projects are now built using TypeScript 💬 Are you using TypeScript in your projects or still on JavaScript? #TypeScript #React #NextJS #Frontend #WebDevelopment #JavaScript #Coding #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Mastering React Hooks! 🚀 Ever wondered how to manage state in functional components? React Hooks is the answer! They allow you to add state and other React features to functional components without writing a class. Super convenient, right? 🤩 For developers, mastering React Hooks opens up a whole new world of possibilities in simplifying component logic and making code more readable. So let's dive in step by step: 1️⃣ First, import { useState } from 'react' 2️⃣ Then, declare a state variable using useState hook 3️⃣ Use the state variable and a function to update it Here's an example: ```jsx import React, { useState } from 'react'; function Counter() { const [count, setCount] = useState(0); return ( <div> <p>You clicked {count} times</p> <button onClick={() => setCount(count + 1)}>Click me</button> </div> ); } ``` Pro Tip: Remember to always keep the dependencies array updated to avoid unwanted re-renders! 🌟 Common Mistake Alert: Forgetting to pass all dependencies to the dependencies array can lead to unexpected bugs, so be thorough in checking! ❗️ Ready to level up your React game with Hooks? What cool projects are you planning to build using React Hooks? 💡🛠️ #ReactHooks #JavaScript #WebDev #FrontendDevelopment #StateManagement #LearnToCode #CodeNewbie #TechTips #tharindunipun.lk
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 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
-
🚀 Progress Update: Strengthening My React Fundamentals Lately, I’ve been focusing on going back to the basics and strengthening my core understanding of React. Instead of rushing into advanced topics, I’m making sure my foundation is solid — because that’s what truly makes a difference in the long run. 💡 Concepts I’m Revisiting: Components & Reusability Props vs State useState & useEffect (deep understanding) Handling forms in React Conditional rendering Component lifecycle (in a simple way) 🛠️ What I’m Doing: Rebuilding small features from scratch Practicing clean and readable code Understanding why things work, not just how 📌 Key Learning: Strong fundamentals make everything easier — debugging, scaling, and even learning advanced concepts like Next.js or state management. 🎯 Next Focus: API integration in React (Fetch / Axios) Building small but meaningful projects Consistency over complexity 💯 #ReactJS #WebDevelopment #FrontendDevelopment #LearningInPublic #JavaScript #100DaysOfCode
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