react-native-interactable-reanimated
v0.0.15
Published
react-native-interactable-reanimated made with reanimted and interactable
Downloads
2,331
Maintainers
Readme
react-native-interactable-reanimated
Note
This is a copy of interactable from react-native-reanimated
Install
npm install --save react-native-interactable-reanimated
Usage
import React, { Component } from 'react'
import Interactable from 'react-native-interactable-reanimated'
class Example extends Component {
render() {
return (
<Interactable.View
horizontalOnly={true}
snapPoints={[{x: 0}, {x: -200}]}
onSnap={this.onDrawerSnap}>
// the view that you wrap here will now support interactions
</Interactable.View>
)
}
}
Disclaimer
This is a copy of example app from react-native-interactable project.
There are several changes made to the files here:
- index.js has been added to list all the samples such that they can be presented as react-navigation screens
- all imports of
react-native-interactable
has been replaced and insteadInteractable.js
is loaded from the main folder of the Example app - whenever
Interactable.View
is used withAnimated.Value
we replace importingAnimated
fromreact-native
and importreact-native-reaminated
instead - in
RealChatHeads.js
we modified timing animation to includeeasing
as a config parameter asreanimated
does not currently have a default value for that - in
TinderCard.js
we modified rotation interpolation not to include strings inoutput
array but instead is wrapped in aconcat
node to appenddeg
at the end. This is necessary as reanimated version of interpolate does not support interpolating strings this way. - finally there is a chance some (if not all) of the files has been reformatted by prettier
License
MIT © nomi9995