Skip to content

Commit 2b1a598

Browse files
committed
first commit
0 parents  commit 2b1a598

File tree

51 files changed

+78460
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+78460
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./examples

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
This is a collection of simple demos of React.js.
2+
3+
These demos are purposely written in a simple and clear style. You will easily learn how to use this powerful library from these demos.
4+
5+
## Links
6+
7+
- [Official website](http://facebook.github.io/react)
8+
9+
## Examples
10+
11+
We have several examples [on the website](http://facebook.github.io/react/). Here is the first one to get you started:
12+
13+
```js
14+
var HelloMessage = React.createClass({
15+
render: function() {
16+
return <div>Hello {this.props.name}</div>;
17+
}
18+
});
19+
20+
React.render(
21+
<HelloMessage name="John" />,
22+
document.getElementById('container')
23+
);
24+
```
25+
26+
This example will render "Hello John" into a container on the page.
27+
28+
You'll notice that we used an HTML-like syntax; [we call it JSX](http://facebook.github.io/react/docs/jsx-in-depth.html). 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.
29+
30+
## Installation
31+
32+
The fastest way to get started is to serve JavaScript from the CDN (also available on [cdnjs](https://cdnjs.com/libraries/react) and [jsdelivr](http://www.jsdelivr.com/#!react)):
33+
34+
```html
35+
<!-- The core React library -->
36+
<script src="http://fb.me/react-0.13.1.js"></script>
37+
<!-- In-browser JSX transformer, remove when pre-compiling JSX. -->
38+
<script src="http://fb.me/JSXTransformer-0.13.1.js"></script>
39+
```
40+
41+
We've also built a [starter kit](http://facebook.github.io/react/downloads/react-0.13.1.zip) 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.
42+
43+
If you'd like to use [bower](http://bower.io), it's as easy as:
44+
45+
```sh
46+
bower install --save react
47+
```
48+
49+
## License
50+
51+
BSD licensed

0 commit comments

Comments
 (0)