* Add tabs to installation page (#9275, #9277)
This adds tabs for create-react-app and existing apps to the installation section of the docs. The tab implementation is a simplified version of React Native's installation page.
Fixes#9275.
* Use classList instead of className
* Use same implementation as in RN
React is flexible and can be used in a variety of projects. You can create new apps with it, but you can also gradually introduce it into an existing codebase without doing a rewrite.
React is flexible and can be used in a variety of projects. You can create new apps with it, but you can also gradually introduce it into an existing codebase without doing a rewrite.
<ahref="javascript:void(0);"class="button-newapp"onclick="display('target', 'newapp')">Create a New App</a>
<ahref="javascript:void(0);"class="button-existingapp"onclick="display('target', 'existingapp')">Add React to an Existing App</a>
</div>
<blockclass="fiddle"/>
## Trying Out React
## Trying Out React
If you're just interested in playing around with React, you can use CodePen. Try starting from [this Hello World example code](http://codepen.io/gaearon/pen/rrpgNB?editors=0010). You don't need to install anything; you can just modify the code and see if it works.
If you're just interested in playing around with React, you can use CodePen. Try starting from [this Hello World example code](http://codepen.io/gaearon/pen/rrpgNB?editors=0010). You don't need to install anything; you can just modify the code and see if it works.
If you prefer to use your own text editor, you can also <ahref="/react/downloads/single-file-example.html"download="hello.html">download this HTML file</a>, edit it, and open it from the local filesystem in your browser. It does a slow runtime code transformation, so don't use it in production.
If you prefer to use your own text editor, you can also <ahref="/react/downloads/single-file-example.html"download="hello.html">download this HTML file</a>, edit it, and open it from the local filesystem in your browser. It does a slow runtime code transformation, so don't use it in production.
## Creating a Single Page Application
If you want to use it for a full application, there are two popular ways to get started with React: using Create React App, or adding it to an existing application.
<blockclass="newapp"/>
## Creating a New Application
[Create React App](http://github.com/facebookincubator/create-react-app) is the best way to start building a new React single page application. It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production.
[Create React App](http://github.com/facebookincubator/create-react-app) is the best way to start building a new React single page application. It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production.
```bash
```bash
npm install -g create-react-app
npm install -g create-react-app
create-react-app hello-world
create-react-app my-app
cd hello-world
cd my-app
npm start
npm start
```
```
Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any backend you want. It uses [webpack](https://webpack.js.org/), [Babel](http://babeljs.io/) and [ESLint](http://eslint.org/) under the hood, but configures them for you.
Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any backend you want. It uses build tools like Babel and webpack under the hood, but works with zero configuration.
<blockclass="existingapp"/>
## Adding React to an Existing Application
## Adding React to an Existing Application
@ -134,3 +193,30 @@ The versions above are only meant for development, and are not suitable for prod
To load a specific version of `react` and `react-dom`, replace `15` with the version number.
To load a specific version of `react` and `react-dom`, replace `15` with the version number.
If you use Bower, React is available via the `react` package.
If you use Bower, React is available via the `react` package.
<script>
// Convert <div>...<span><block/></span>...</div>
// Into <div>...<block/>...</div>
var blocks = document.getElementsByTagName('block');