Questions tagged [react-360]

React VR lets you build VR apps using only JavaScript. It uses the same design as React, letting you compose a rich VR world and UI from declarative components.

React VR is a framework for the creation of VR applications that run in your web browser. It pairs modern APIs like WebGL and WebVR with the declarative power of , producing experiences that can be consumed through a variety of devices. Leveraging web technologies and the existing React ecosystem, React VR aims to simplify the construction of 360 experiences and democratize the creation of VR content. If you're familiar with React, you can now build in VR – learn once, write anywhere. React VR takes heavy inspiration from .

It was built and open sourced by Facebook in cooperation with Oculus and was first released on December 13th 2016.

While React VR is available as a standalone npm package, it's much easier to set up a new project by using the React VR CLI tool.

npm install -g react-vr-cli

Once installed, the CLI can be used to create a new project by running:

react-vr init PROJECT_NAME

Below is the starter template that your new project will contain:

import React from 'react';
import {AppRegistry, Pano, Text, View} from 'react-vr';

class WelcomeToVR extends React.Component {
  render() {
    // Displays "hello" text on top of a loaded 360 panorama image.
    // Text is 0.8 meters in size and is centered three meters in front of you.
    return (
      <View>
        <Pano source={asset('chess-world.jpg')}/>
        <Text
          style={{
            fontSize: 0.8,
            layoutOrigin: [0.5, 0.5],
            transform: [{translate: [0, 0, -3]}],
          }}>
          hello
        </Text>
      </View>
    );
  }
};

AppRegistry.registerComponent('WelcomeToVR', () => WelcomeToVR);

Official links

119 questions
1
vote
1 answer

Persistent bridge between a React VR component and native module code

I am trying to have my browser send in some DOM events into the React VR components. The closest I got is this code using "native modules." (client.js) const windowEventsModule = new WindowEventsModule(); function init(bundle, parent, options) { …
panta82
  • 2,763
  • 3
  • 20
  • 38
1
vote
1 answer

Native mobile app with React VR

I have a bit of experience with React JS & React Native. Now I have just started with React VR. From what I have learnt so far, one can use React VR to create virtual reality experiences in web pages. I have a web application which uses Three JS to…
Debojyoti Ghosh
  • 375
  • 1
  • 2
  • 17
1
vote
1 answer

What web platform is React VR intended to be built on?

I would like to begin developing with React VR, particularly with Google Cardboard, however, I am not sure if Google Cardboard is optimized for React VR. I am wondering if React VR is intended for more robust VR platforms like Daydream, Oculus, HTC…
Colin Sygiel
  • 917
  • 6
  • 18
  • 29
1
vote
0 answers

How to increase react vr frame rate

Background I am building a proof of concept for a webvr project. After attending the react amsterdam conference last month and seeing react vr in action I thought this would be a good place to start. I have setup a demo page here. It's just an…
Joe Lloyd
  • 19,471
  • 7
  • 53
  • 81
1
vote
0 answers

I want to have 4 squares of text of equal width around the user in React-VR

Using React-VR, it's easy to have lines of text in front, behind, and to the left and right of the user. But the width of each element is set by the amount of text, so the width is far too long. Attempting to set the width to 3 for each element…
Yoni Binstock
  • 241
  • 4
  • 19
1
vote
0 answers

Change language of React VR application manually

I'm making an application using React VR in two languages: Dutch and French. For that I'll use browser detection and use this code: var language = navigator.language || navigator.userLanguage; This works grate inside my code. The problem is when I…
H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
1
vote
1 answer

How can I use utf-8 in react vr?

Does React VR support utf-8? Example: export default class vrhw extends React.Component { render() { return (
liyuechun
  • 11
  • 1
1
vote
0 answers

Firebase inside ReactNative (ReactVR) websocket error

I am trying to use Firebase Realtime Database from inside ReactVR (which is built on top of ReactNative). When I try to listen on a ref though, it throws Error during WebSocket handshake: Unexpected response code: 500 though. Here is the code I have…
1
vote
1 answer

How to create events using React Native

I'm making an application using React VR. If you don't know React VR, well it's based on React Native with some other components, includes Three.js and other stuff, specific for using WebVR. I've making a component named NavigateButton. Below is my…
H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
0
votes
1 answer

Uncaught ReferenceError: React360 is not defined (Its a matter of my Graduation. So I will be very grateful)

My react360 project was running fine. But I installed react-router-dom@5.0.2. After that my project didnt start. It gave this error: enter image description here My package.json file was : enter image description here After that I updated the react…
0
votes
2 answers

How can I use a 3d scene in a React Web App?

I need a piece of advice. I want to create a React web application with React using typescript and I want when clicking a button to show a new page with a scene of a town. What is the best way to make it possible, I mean to integrate the scene in…
engine_pc
  • 1
  • 1
0
votes
1 answer

I get an error creating a react-360 project

I get this error when I start a new react-360 project using react-360 init myProject.It creates the folder but when I npm start it gives me more errors. react-360 init MyProject (node:17583) ExperimentalWarning: The fs.promises API is…
sam rafiei
  • 51
  • 1
  • 6
0
votes
0 answers

How can I add react 360 on a regular react site?

I want to add 3d viewing option to my navigation. Currently, I see the only option is to add react-360 as an iframe but how can I actually take them from my regular site to 360 mode? Please see example below. If you click on view on wall that's…
Tiggy Jt
  • 1
  • 3
0
votes
1 answer

React 360 and Cloud Firestore: status 400 when trying to write to database

I'm working on a React 360 app which requires a user to sign up while in VR mode. The relevant code in my SignUp.js file is as follows: import fire from "../../Firebase"; import "firebase/firestore"; const db = fire.firestore(); export default…
0
votes
1 answer

Responsive flat panel in react-360

I would like to make responsive flat panel - on a mobile device should be in full screen like there https://tour.croptrust.org/ Is there a possibility to achieve that in react-360. Here is my example https://gstuczynski.com/tour/plaszow/ - try to…
tyskocz
  • 133
  • 1
  • 8