Skip to content

feat(theme)!: remove animation.scale and export useReduceMotion - #5235

Merged
Doberjohn merged 6 commits into
mainfrom
@Doberjohn/remove-animation-scale
Nov 18, 2026
Merged

Doberjohn merged 6 commits into
mainfrom
@Doberjohn/remove-animation-scale

Conversation

@Doberjohn

Copy link
Copy Markdown
Collaborator

Motivation

theme.animation.scale reached 16 components, while Checkbox, Switch, FAB and others read only useReduceMotion(), and a component theme prop could undo reduceMotion="on". This removes theme.animation: the 16 read useReduceMotion(), now exported with ReduceMotionPreference. 'auto' starts from the launch-time device setting. The guides are updated.

Related issue

Follow-up to #4924.

Screenshots / Videos

None: nothing changes with default settings.

Test plan

  • yarn typecheck, yarn lint, yarn test.
  • Web: Menu, Dialog, Snackbar, Banner, Chip and ProgressBar keep their durations, and snap with reduceMotion="on".
  • iOS 27.2, Android 13: Dialog and RadioButton work with the device setting off and on; 'auto' reads it on the first render.

@github-actions

Copy link
Copy Markdown

Found potential problems with the pull request:

  • Screenshot or video evidence is missing. Make sure to include one if it affects the UI.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 2 new findings on 38d67ab. The verdict and the full list are in the summary comment.

Comment thread src/core/useResolvedReduceMotion.ts Resolved
Comment thread docs/6.x/docs/guides/theming.mdx Resolved
@apex-sentinel-staging

This comment has been minimized.

The 16 components that multiplied durations by `theme.animation.scale`
now read `useReduceMotion()`, which is exported with the
`ReduceMotionPreference` type. A component's `theme` prop can no longer
turn animations back on under reduce motion, `'auto'` starts from the
device setting at launch, and an OS setting change no longer replays
Banner, CrossFadeIcon or ActivityIndicator animations.

BREAKING CHANGE: `theme.animation.scale` is removed; pass
`reduceMotion="on"` to `PaperProvider` to turn animations off, and read
the preference with `useReduceMotion()`.
@Doberjohn
Doberjohn force-pushed the @Doberjohn/remove-animation-scale branch from fdabe19 to 21884d4 Compare November 18, 2026 00:55
@apex-sentinel-staging

This comment has been minimized.

@Doberjohn Doberjohn added this to the 6.0.0-beta.0 milestone Nov 18, 2026
Comment thread docs/6.x/docs/guides/migration.md Resolved
Comment thread src/components/ProgressBar.tsx Resolved
@Doberjohn Doberjohn self-assigned this Nov 18, 2026
useMotionDuration() returns a stable function that gives back the
duration it is passed, or 0 under reduce motion, read when it is called.
ActivityIndicator, Banner, BottomNavigation, BottomNavigationBar,
CrossFadeIcon, Drawer.CollapsedItem, Menu, Modal, ProgressBar,
RadioButtonAndroid and Snackbar use it, so every call site passes its
duration.

Badge, Chip, Surface, Button, Checkbox and Modal's transition styles
keep reading useReduceMotion(): they compute durations during render,
where the function can still return the previous render's value.
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of d9a654d

Since the review of 21884d4: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' prompt (1 file)
  • src/components/__tests__/__snapshots__/ListSection.test.tsx.snap: generated or a lockfile, so its lines were left out

1 finding below minor hidden (user_settings.min_severity).

1 new finding away from what changed since 21884d4 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (a525c28839e4).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@Doberjohn
Doberjohn merged commit b354fa9 into main Nov 18, 2026
14 checks passed
@Doberjohn
Doberjohn deleted the @Doberjohn/remove-animation-scale branch November 18, 2026 12:38
lukemorawski added a commit to lukemorawski/react-native-paper that referenced this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants