Facebook is releasing React VR, a new library that lets developers build experiences for VR by using standard web tools.
Those experiences can then be distributed across the web - React VR leverages APIs like WebGL and WebVR to connect headsets with a scene in a web page. And to maximize your potential audience, sites built in React VR are also accessible on mobile phones and PCs, using accelerometers or the cursor for navigation.
With React VR, you can use React components to compose scenes in 3D, combining 360 panoramas with 2D UI, text, and images. You can immerse the user with audio and video capabilities, plus take full advantage of the space around you with 3D models. The entire codebase is available on GitHub.
Facebook says that anyone familiar with React can easily get started without needing to learn new concepts.
How it works
As it turns out, React Native already addresses similar problems with its architecture. Facebook followed RN's pattern by running React and rendering in separate contexts, with an asynchronous bridge for communication between them. In the web browser, this separation is performed with a web worker - your entire React application runs in the worker, while the rendering code that turns scene update messages into actual pixels lives in the main window. This lets the renderer create a tight loop between receiving headset orientation updates and re-rendering the scene, increasing viewer immersion while decreasing the likelihood of motion sickness.