Skip to main content

Featured

🎉 Day 46 — React Mastery Completed (Final Summary & Congratulations!)

🎉 Day 46 — React Mastery Completed (Final Summary & Congratulations!) Congratulations, developer! 👏 You’ve successfully completed the 45-Day React.js Roadmap — from understanding the fundamentals to mastering advanced concepts like Redux, Routing, Testing, and Deployment. 📘 What You’ve Learned ✅ React basics — Components, JSX, Props, and State ✅ Hooks — useState, useEffect, useRef, useMemo, and Custom Hooks ✅ Context API and Redux Toolkit for global state management ✅ Routing with React Router & Protected Routes ✅ Data fetching using Fetch API, Axios, React Query ✅ Advanced Patterns — Compound Components, Render Props, HOCs ✅ Styling — CSS Modules, Styled Components, Theming ✅ Animations, Accessibility, Testing, and Performance Optimization ✅ Deployment on Vercel, Netlify, or GitHub Pages 🧩 Final Project Ideas Now that you’re done, build real-world apps to polish your skills: 📝 Task ...

🎞 Day 39 — Animations in React: CSS Transitions & Framer Motion

🎞 Day 39 — Animations in React: CSS Transitions & Framer Motion

Animations enhance user experience by providing smooth transitions and interactive feedback. React supports animation through both CSS transitions and powerful libraries like Framer Motion.

✨ CSS Transitions Example

import React, { useState } from "react";
import "./Box.css";

export default function AnimatedBox() {
  const [active, setActive] = useState(false);
  return (
    <div>
      <button onClick={() => setActive(!active)}>Toggle Box</button>
      <div className={active ? "box active" : "box"}></div>
    </div>
  );
}
  

Box.css:

.box {
  width: 100px;
  height: 100px;
  background-color: tomato;
  transition: all 0.4s ease;
}

.box.active {
  transform: translateX(150px);
  background-color: limegreen;
}
  

⚡ Framer Motion Example

import { motion } from "framer-motion";

export default function MotionBox() {
  return (
    <motion.div
      animate={{ rotate: 360 }}
      transition={{ duration: 2, repeat: Infinity }}
      style={{ width: 100, height: 100, backgroundColor: "purple" }}
    />
  );
}
  

Using animations effectively helps create delightful user experiences — but remember to keep them subtle and purposeful!

Comments