November 2017
Beginner
294 pages
6h 55m
English
We added a lot of code; let's summarize where we are. React VR can sometimes be confusing, as it is a mixture of JavaScript and XML "ish" code (JSX), so here is the complete and total index.vr.js:
import React from 'react';import { AppRegistry, Animated, asset, Easing, NativeModules, Pano, Sound, Text, View, VrButton} from 'react-vr';const cubeModule = NativeModules.CubeModule;class GoingNative extends React.Component { constructor(props) { super(props); this.state = { btnColor: 'white', cubeColor: 'yellow' }; cubeModule.changeCubeColor(this.state.cubeColor); } render() { return ( <View style={{ transform: [{ translate: [0, 0, -3] }], layoutOrigin: [0.5, 0, 0], alignItems: 'center', }}> <Pano source={asset('chess-world.jpg')} ...Read now
Unlock full access