motiondivision / motiondivision/motion

[BUG] motion.div is not binding correctly when ref changes

Open
#2,263 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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.div is not binding correctly when ref changes

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/s/laughing-cartwright-26zghl?file=/src/App.tsx

4. Steps to reproduce

Click the refresh button, and then observe the console.log information

5. Expected behavior

When ref changes, ref.current should always get the correct dom

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction in src/App.tsx and follow the refresh-button interaction while inspecting the console output. Trace how motion.div handles the changing ref, then verify that ref.current points to the correct DOM element after each refresh.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.