7
React Native Draggable View
source link: https://reactnativeexample.com/react-native-draggable-view/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
React Native Draggable View
May 11, 2022
1 min read
React Native Draggable Reanimated
This package help you easy to drag any view
react-native-reanimated V2
Getting started
$ npm install react-native-draggable-reanimated --save
$ yarn add react-native-draggable-reanimated
- All in one
$ npm install react-native-draggable-reanimated react-native-gesture-handler react-native-reanimated --save && cd ios && pod install
Usage
import DraggableView from 'react-native-draggable-reanimated';
<DraggableView
initValue={{ x: 100, y: 100 }}
onRelease={(val) => {
console.log(val);
}}>
<View
style={{
backgroundColor: 'red',
width: BOX_SIZE,
height: BOX_SIZE,
}}
/>
</DraggableView>
License
This module is MIT licensed
GitHub
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK