-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
44 lines (36 loc) · 942 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/import React, { Component, PropTypes } from 'react';
import {
AppRegistry,
StyleSheet,
View,
requireNativeComponent
} from 'react-native';
const NativeImageView = requireNativeComponent('LTPerspectiveImageView', PerspectiveImage);
export default class PerspectiveImage extends Component {
static propTypes = {
offset: PropTypes.number,
uri: PropTypes.string.isRequired
};
props: PropsType;
constructor(props) {
super(props);
}
setNativeProps(props: PropsType) {
this.refs.self.setNativeProps(props);
}
render() {
const {
offset,
uri,
...otherProps
} = this.props;
return (
<NativeImageView offset={ offset || 5 } uri={uri} ref='self' {...otherProps} />
)
}
}
AppRegistry.registerComponent('PerspectiveImage', () => PerspectiveImage);