useReducedMotion
Subscribes to OS-level Reduce Motion accessibility preferences on iOS and Android so animations degrade gracefully.
v0.2.0NativeWindStyleSheetiOSAndroidExpo Go
Installation
npx nativra-cli add use-reduced-motionWrites use-reduced-motion.ts to hooks, rewrites imports to your aliases and records hashes in nativra.lock.json. Existing files are never overwritten without asking.
Want to try it first? Open it in the playground: a real React Native project in your browser, with this item installed by the CLI.
Usage
The useReducedMotion hook queries AccessibilityInfo.isReduceMotionEnabled() and listens to "reduceMotionChanged" events so components can skip spring/timing transitions when the user requests reduced motion.
Installation
npx nativra-cli add use-reduced-motionUsage
import { useReducedMotion } from "@/hooks/use-reduced-motion";
export function AnimatedCard() {
const reduceMotion = useReducedMotion();
const duration = reduceMotion ? 0 : 250;
// Pass duration to Animated.timing or Reanimated withTiming
}Source
Exactly what the CLI writes, before your import aliases are applied.