gunnartorfis / sonner-native

An opinionated toast component for React Native. A port of @emilkowalski's sonner.
https://gunnartorfis.github.io/sonner-native
MIT License
451 stars 18 forks source link

Reanimated Reduced motion #128

Closed janroures closed 1 month ago

janroures commented 1 month ago

Hello, thanks for this amazing lib. I was wondering how to customize the reduced motion setting in reanimated. Animations won't work if we can't set reduceMotion: ReduceMotion.Never

janroures commented 1 month ago

would be nice to be able to customize reanimated animation options.

Thank you 🙏

gunnartorfis commented 1 month ago

Hey @janroures I'm not too deep in reduceMotion - would we have to read the reduce motion on the device settings if we'd want to support this within the lib, and apply it to our animations?

Would you be open to create a PR?

janroures commented 1 month ago

Hi @gunnartorfis thanks for your response,

No, what I mean is that it would be nice to be able to assign the Reduced Motion values that reanimated already has built-in as a global or local prop of the toast, and have it modify the options of the withTiming, withSpring animations, etc. of the toast.

Something like toast.success("Hello, world", { reduceMotion: ReduceMotion.Never } or <Toaster theme="dark" toastOptions={{ reduceMotion: ReduceMotion.Never }}/>

this is from reanimated:

Captura de pantalla 2024-10-04 a les 19 22 33 Captura de pantalla 2024-10-04 a les 19 29 16

Hope I explained myself well!! Thank you

hyoban commented 1 month ago

I think you can already do this with ReduceMotionConfig

janroures commented 1 month ago

Didn't know about this. Thank you!!!