Skip to content

Commit 4f12fa8

Browse files
0.1.6
- The example project is simple.
1 parent 7e2fe78 commit 4f12fa8

File tree

2 files changed

+21
-39
lines changed

2 files changed

+21
-39
lines changed

example/src/App.tsx

+20-38
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,27 @@
1-
import React, { Component } from 'react';
1+
import React, { useRef } from 'react';
2+
import { StyleSheet, View } from 'react-native';
3+
import { SceneformView } from '../../src';
24

3-
import { StyleSheet, View, Button, FlatList, TouchableOpacity, Text } from 'react-native';
4-
import { SceneformView, AugmentedFacesView } from '../../src';
5+
const App = () => {
6+
const sceneformView = useRef(null);
57

6-
export default class App extends Component {
7-
constructor(props){
8-
super(props);
9-
this.state = {
10-
11-
}
12-
}
13-
14-
componentDidMount(){
15-
16-
}
17-
18-
render(){
19-
return (
20-
<View style={styles.container}>
21-
<SceneformView
22-
ref={(c) => this.sceneformview = c}
23-
style={styles.box}
24-
onTapPlane={(event) => {
25-
this.sceneformview.addObject({name: "models/Rabbit.glb", anchorId: event.planeId, isCloudAnchor: false});
26-
}}
27-
/>
28-
</View>
29-
);
30-
}
8+
return (
9+
<View style={styles.container}>
10+
<SceneformView
11+
ref={sceneformView}
12+
style={styles.container}
13+
onTapPlane={(event) => {
14+
sceneformView.current.addObject({name: "models/Rabbit.glb", anchorId: event.planeId, isCloudAnchor: false});
15+
}}
16+
/>
17+
</View>
18+
);
3119
}
3220

3321
const styles = StyleSheet.create({
3422
container: {
35-
width: "100%",
36-
height: "100%",
37-
alignItems: 'center',
38-
justifyContent: 'center',
39-
},
40-
box: {
41-
width: "100%",
42-
height: "100%",
43-
marginVertical: 20,
44-
},
23+
flex: 1
24+
}
4525
});
26+
27+
export default App;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sceneview/react-native-sceneform",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "Sceneform for React Native",
55
"main": "lib\\commonjs\\index.js",
66
"module": "lib\\module\\index.js",

0 commit comments

Comments
 (0)