Muskan Jaiswal’s Post

🚀 Day 3/30 — React Machine Coding Challenge Built a Dynamic Work Experience Form (Add / Remove Rows) 🧩 Requirements covered: - Add multiple experiences (company, title, start, end, description) - Remove any row dynamically - Validate required fields - Ensure start date ≤ end date 🧠 Before coding, I asked myself: - Should I manage everything in one big state or split it? - How to validate before adding a new row? - How to keep the UI simple but still handle errors cleanly? 💡 My Approach: - Used a single form state for current input - Stored all experiences in an array - On “Add” → validate → push into array - Reset the form after adding - Maintained field-level error object for validation - Removed items using simple filter logic ⚡ Key Learning: Keeping validation separate and simple makes the logic much easier to manage, especially under time pressure. Now your turn 👇 Try building this and share your approach/code in the comments. I’ll review and give feedback. If you're preparing for frontend interviews, follow along — new challenge every day. #30DaysOfCode #ReactJS #MachineCoding #FrontendDevelopment #InterviewPrep #BuildInPublic #JavaScript

To view or add a comment, sign in

Explore content categories