mirror of
https://github.com/zhigang1992/react-native-reanimated.git
synced 2026-06-17 05:29:15 +08:00
26 lines
585 B
JavaScript
26 lines
585 B
JavaScript
import React from 'react';
|
|
import { StyleSheet } from 'react-native';
|
|
import Animated from 'react-native-reanimated';
|
|
|
|
/**
|
|
* Needs to be a class component for react-native-gesture-handler to put a ref on it.
|
|
*/
|
|
export default class Box extends React.Component {
|
|
render() {
|
|
const { style, ...props } = this.props;
|
|
return <Animated.View style={[styles.box, style]} {...props} />;
|
|
}
|
|
}
|
|
|
|
const BOX_SIZE = 44;
|
|
|
|
const styles = StyleSheet.create({
|
|
box: {
|
|
width: BOX_SIZE,
|
|
height: BOX_SIZE,
|
|
alignSelf: 'center',
|
|
backgroundColor: 'blue',
|
|
margin: 10,
|
|
},
|
|
});
|