Go to file
Ben Alpert dea7efbe16 Merge pull request #3555 from spicyj/native-overrides
Import ResponderEventPlugin from react-native
2015-04-02 14:13:35 -07:00
bin Fix module option parsing of jsx command 2015-03-11 14:26:51 -07:00
docs use 'forEach' instead of 'map' when clearing intervals 2015-04-02 14:06:08 +03:00
examples Update index.html 2015-03-27 15:17:07 -05:00
gem-react-source BSD + PATENTS 2014-10-10 13:34:07 -07:00
grunt Keep docs/js/{react,JSXTransformer}.js in repo 2015-03-28 14:56:54 -07:00
jest lint from root 2015-02-20 04:06:15 +03:00
npm-jsx_orphaned_brackets_transformer jsx_orphaned_brackets_transformer v1.0.1 2015-03-11 15:52:54 -07:00
npm-react minor fixes in package.json 2015-03-22 22:09:24 +02:00
npm-react-codemod npm-react-codemod: Class transform doesn’t need an alias for `module.exports = React.createClass` any longer. 2015-03-25 16:31:23 -07:00
npm-react-tools Documents that JSX tool is transforming files with .js extension (and not .jsx) by default 2015-01-31 20:59:18 +01:00
scripts AUTHORS 2013-09-09 23:42:54 -07:00
src Merge pull request #3555 from spicyj/native-overrides 2015-04-02 14:13:35 -07:00
starter Add space after ellipses 2014-09-23 17:01:23 -07:00
test eslint 2015-02-13 02:43:42 +03:00
vendor Merge pull request #3549 from spicyj/trans-sync 2015-03-30 14:15:09 -07:00
.editorconfig Don't forcibly wrap lines in git commit messages 2014-04-06 23:17:51 -07:00
.eslintignore Autobuild website on Travis from stable branch 2015-03-30 10:56:41 -07:00
.eslintrc update eslint rules 2015-02-13 02:44:32 +03:00
.gitattributes .gitattributes to ensure LF line endings when we should 2014-01-17 16:25:53 -08:00
.gitignore Autobuild website on Travis from stable branch 2015-03-30 10:56:41 -07:00
.mailmap Update AUTHORS for 0.13 2015-03-10 13:55:55 -07:00
.travis.yml Fix inverted feature test in .travis.yml 2015-04-01 15:12:17 -07:00
AUTHORS Update AUTHORS for 0.13 2015-03-10 13:55:55 -07:00
CHANGELOG.md Changelog for 0.13.1 2015-03-16 16:59:21 -07:00
CONTRIBUTING.md Contributing: cleanup quote style 2015-02-20 12:06:33 +02:00
Gruntfile.js Keep docs/js/{react,JSXTransformer}.js in repo 2015-03-28 14:56:54 -07:00
LICENSE Fix Outdated Copyright Year 2015-01-05 13:52:20 -05:00
LICENSE-docs Update licenses for docs and examples 2014-10-22 12:35:08 -07:00
LICENSE-examples Update licenses for docs and examples 2014-10-22 12:35:08 -07:00
PATENTS BSD + PATENTS 2014-10-10 13:34:07 -07:00
README.md Update README.md 2015-03-28 10:55:15 -07:00
main.js Fix module option parsing of jsx command 2015-03-11 14:26:51 -07:00
package.json Keep docs/js/{react,JSXTransformer}.js in repo 2015-03-28 14:56:54 -07:00

README.md

React Build Status

React is a JavaScript library for building user interfaces.

  • Just the UI: Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
  • Virtual DOM: React abstracts away the DOM from you, giving a simpler programming model and better performance. React can also render on the server using Node, and it can power native apps using React Native.
  • Data flow: React implements one-way reactive data flow which reduces boilerplate and is easier to reason about than traditional data binding.

NEW! Check out our newest project React Native, which uses React and JavaScript to create native mobile apps.

Learn how to use React in your own project..

Examples

We have several examples on the website. Here is the first one to get you started:

var HelloMessage = React.createClass({
  render: function() {
    return <div>Hello {this.props.name}</div>;
  }
});

React.render(
  <HelloMessage name="John" />,
  document.getElementById('container')
);

This example will render "Hello John" into a container on the page.

You'll notice that we used an HTML-like syntax; we call it JSX. JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML. A simple transform is included with React that allows converting JSX into native JavaScript for browsers to digest.

Installation

The fastest way to get started is to serve JavaScript from the CDN (also available on cdnjs and jsdelivr):

<!-- The core React library -->
<script src="http://fb.me/react-0.13.1.js"></script>
<!-- In-browser JSX transformer, remove when pre-compiling JSX. -->
<script src="http://fb.me/JSXTransformer-0.13.1.js"></script>

We've also built a starter kit which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.

If you'd like to use bower, it's as easy as:

bower install --save react

Contribute

The main purpose of this repository is to continue to evolve React core, making it faster and easier to use. If you're interested in helping with that, then keep reading. If you're not interested in helping right now that's ok too. :) Any feedback you have about using React would be greatly appreciated.

Building Your Copy of React

The process to build react.js is built entirely on top of node.js, using many libraries you may already be familiar with.

Prerequisites

  • You have node installed at v0.10.0+ (it might work at lower versions, we just haven't tested).
  • You are familiar with npm and know whether or not you need to use sudo when installing packages globally.
  • You are familiar with git.

Build

Once you have the repository cloned, building a copy of react.js is really easy.

# grunt-cli is needed by grunt; you might have this installed already
npm install -g grunt-cli
npm install
grunt build

At this point, you should now have a build/ directory populated with everything you need to use React. The examples should all work.

Grunt

We use grunt to automate many tasks. Run grunt -h to see a mostly complete listing. The important ones to know:

# Build and run tests with PhantomJS
grunt test
# Build and run tests in your browser
grunt test --debug
# For speed, you can use fasttest and add --filter to only run one test
grunt fasttest --filter=ReactIdentity
# Lint the code with ESLint
grunt lint
# Wipe out build directory
grunt clean

License

React is BSD licensed. We also provide an additional patent grant.

React documentation is Creative Commons licensed.

Examples provided in this repository and in the documentation are separately licensed.

More…

There's only so much we can cram in here. To read more about the community and guidelines for submitting pull requests, please read the Contributing document.