react-native-reanimated
Version:
More powerful alternative to Animated library for React Native.
15 lines (12 loc) • 452 B
text/typescript
;
import { IS_WINDOW_AVAILABLE } from './common';
import { createReducedMotionManager } from './ReducedMotionCommon';
export function isReducedMotionEnabledInSystem() {
return IS_WINDOW_AVAILABLE
? // @ts-ignore Fallback if `window` is undefined.
window.matchMedia('(prefers-reduced-motion: reduce)').matches
: false;
}
export const ReducedMotionManager = createReducedMotionManager(
isReducedMotionEnabledInSystem()
);