-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(react-motion): add replayKey prop to replay motion without remounting #36108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
robertpenner
merged 13 commits into
microsoft:master
from
robertpenner:feat/motion-component-replay-key
May 14, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
cbc1a2e
feat(react-motion): add replayKey prop to replay motion without remou…
robertpenner cfbab93
chore: add change file for react-motion replayKey
robertpenner 630e70d
fix(react-motion): wrap replayKey @example in code fence to fix TSDoc…
robertpenner b56fb33
feat(react-motion): add replayKey story with side-by-side before/afte…
robertpenner dad2b0d
chore(react-motion): polish replayKey story — primary button, explici…
robertpenner cbec663
fix(react-motion): fix ref type in TrackedChild test helper
robertpenner e8aceb6
refactor(react-motion): replay replayKey imperatively via cancel+play…
robertpenner 8a8fe12
test(react-motion): add test for onMotionStart and onMotionFinish fir…
robertpenner 1f74d0e
refactor(react-motion): DRY up handle wiring into startHandle; add te…
robertpenner 93f35f8
refactor(react-motion): rename startAnimationHandle to activateAnimat…
robertpenner 1fb6429
fix(react-motion): avoid replay on initial StrictMode mount
robertpenner cb7d6ef
chore(react-motion): add replayKey example snippets in story layout
robertpenner 716f6f3
fix(react-motion): make StrictMode replayKey test React 17 compatible
robertpenner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-motion-b1997662-a01c-4258-b43e-d8022aab59b3.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "minor", | ||
| "comment": "feat(react-motion): add replayKey prop to replay motion without remounting", | ||
| "packageName": "@fluentui/react-motion", | ||
| "email": "robertpenner@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ion/stories/src/CreateMotionComponent/CreateMotionComponentReplayKey.stories.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| The `replayKey` prop retriggers the animation each time its value changes, without remounting the component. Unlike changing a React `key`, which destroys and recreates the subtree, `replayKey` reruns only the animation while keeping the DOM, focus, and child state intact. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.