motiondivision / motiondivision/motion
[BUG] motion.svg style prop changes don't get applied
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 33.7k
- Forks
- 1.4k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 14
Description
1. Read the FAQs 👇
2. Describe the bug
motion.svg motion.svg style prop changes don't get applied.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/s/quirky-bhabha-qh8hrn?file=/src/App.tsx
4. Steps to reproduce
Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/quirky-bhabha-qh8hrn?file=/src/App.tsx
- Click on the red rectangle next to "motion.svg"
- Expected result: the rectangle turns from red to blue
- Actual result: the rectangle stays red
5. Expected behavior
Style prop changes on motion.svg should be reflected on the SVG element similar to using a regular svg element. Using a MotionValue works but I'd prefer not to have to create a MotionValue for each style properties. This works as expected on motion.div.
6. Video or screenshots
If applicable, add a video or screenshots to help explain the bug.
7. Environment details
MacOS, issue is on chrome, safari
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CodeSandbox reproduction and its src/App.tsx entry point; reproduce the click and inspect the motion.svg style-prop change against the stated regular svg expectation. Done means the rectangle changes from red to blue through a style prop without creating a MotionValue, while preserving the reported motion.div behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100