-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add ReducedMotionConfig
component
#6164
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of overriding it this simply!
packages/react-native-reanimated/src/component/ReduceMotionConfig.tsx
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/component/ReduceMotionConfig.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it lacks some logic
packages/react-native-reanimated/src/component/ReduceMotionConfig.tsx
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/component/ReduceMotionConfig.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's fine 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the refactor - just please tak a look at linter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
ReduceMotionConfig
componentReducedMotionConfig
component
## Summary Documentation for component `ReduceMotionConfig` added in #6164 ![image](https://github.com/software-mansion/react-native-reanimated/assets/36106620/16098702-202a-48b8-8589-fe739a6f5d53) #6164 - needs to be merged before https://github.com/user-attachments/assets/bc6e467b-5ab3-4e77-94b6-7d792541643f
Awesome. Thanks for working on this important topic ❤️ |
Hi guys, do we really need this annoying warning on every app init in dev mode?
If it was overwritten, it was done on purpose, so what is the point to remind about it on every app reload in dev? |
To avoid confusion, if any library that you depend on call it in their code. If you want to silence this warning, just use: import { LogBox } from 'react-native';
LogBox.ignoreLogs(['[Reanimated] Reduced motion']); |
Summary
This PR adds
ReduceMotionConfig
component that allows to determine the default animation behavior in response to the device's reduced motion accessibility setting. It affects application globally. The default behavior disables all animation if reduced motion is enabled on a device. You can utilize this component to override that behavior.Usage
Demo
Screen.Recording.2024-06-24.at.18.25.37.mov
Test plan
Open
Reduce Motion
example from example app.