Skip to content

fix: prevent Framer Motion props from reaching DOM elements#1900

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
anshika1179:fix/framer-motion-dom-props-warning
May 30, 2026
Merged

fix: prevent Framer Motion props from reaching DOM elements#1900
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
anshika1179:fix/framer-motion-dom-props-warning

Conversation

@anshika1179
Copy link
Copy Markdown
Contributor

Description

Fixes React warnings caused by Framer Motion animation props being passed directly to native DOM elements during test execution.

The test suite's vi.mock('framer-motion') implementation was naively spreading all component props (including whileHover, whileTap, and whileInView) directly onto native HTML elements in the virtual DOM. The warnings were artifacts of the test environment, as the actual production components correctly used motion.* abstractions.

This PR updates the mocks to intercept and strip out animation props before rendering the fallback DOM elements, completely cleaning up the test logs.

Fixes #1896

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

(No visual changes. This PR strictly cleans up React prop warnings during test execution and local development).

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 30, 2026

@anshika1179 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@JhaSourav07 JhaSourav07 merged commit 0e4f492 into JhaSourav07:main May 30, 2026
5 of 6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 Congratulations @anshika1179! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@JhaSourav07 JhaSourav07 added GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:exceptional Outstanding contribution with exceptional implementation quality, testing. gssoc:approved PR has been reviewed and accepted for valid contribution points mentor:Aamod007 labels May 30, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:exceptional Outstanding contribution with exceptional implementation quality, testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: React warning - Framer Motion props passed to native DOM elements

2 participants