Switch XX
A custom animated switch component that mirrors the API of React Native’s built-in `Switch`, making it a true plug-and-play replacement. It’s written in TypeScript and leverages `react-native-reanimated` for smooth animations, along with `react-native-gesture-handler` to support a `LongPress` gesture.
This component is fully customizable and supports the following props:
* `onValueChange`: Callback triggered with the new `value` when the switch changes state
* `value`: The current value of the switch (controlled mode)
* `defaultValue`: The initial value of the switch (uncontrolled mode)
* `size`: Controls the overall size of the switch
* `disabled`: Disables the switch and prevents gesture interactions
Ideal for replacing the native `Switch` with a more animated and interactive experience—no extra setup needed.