This guide will help you install the tools necessary for creating your first interactive experience with React 360.
Before getting started, you'll need to install Node.js. While React 360 runs in your web browser, the build pipeline that bundles up your code relies on Node.
- Mac: On Mac, we recommend installing Node.js through Homebrew.
- Windows: Get the Windows installer from the nodejs.org download page.
- Linux: Go to the nodejs.org package manager page to find specific instructions for your Linux distribution.
Once Node has been installed, you can fetch the React 360 CLI, a tool that lets you create and manage your React 360 projects. Open a terminal and run the following command.
npm install -g react-360-cli
This fetches the latest version of the CLI and installs it on your system. After installation, we can use it to generate the initial code for our first project. Start by navigating to a directory where you would like to put your new project, and run the command to create a new project called Hello360.
react-360 init Hello360
This creates a new directory called Hello360, with all of the files needed to run your project. Enter the directory to view them.
When we build React 360 applications, we have a number of source code and library files that need to be bundled into a single file for a web browser to load. You may have encountered some of these tools if you're familiar with web development; React 360 ships with its own. Metro is the JS bundler used by projects like React 360 and React Native, and is designed to meet their needs.
During development, the bundler runs a local server that allows you to access your project. It serves up the files for your project, doing any necessary compilation or processing at request time. When you're ready to publish your project, you can instruct the bundler to build production versions of these files, so you can place them on any web server. For now, start the development server with the following command.