software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.59k stars 1.26k forks source link

Add `ReduceMotionConfig` component #6164

Open piaskowyk opened 5 days ago

piaskowyk commented 5 days ago

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

function App() {

  return (
    // ...
    <ReduceMotionConfig mode={ReduceMotion.Never} />
    // ...
  );
}

Demo

https://github.com/software-mansion/react-native-reanimated/assets/36106620/e15a484e-bdc1-454c-b9ff-3ae8863db62e

Test plan

Open Reduce Motion example from example app.