Added literallycanvas and react libraries.
[openemr.git] / library / js / react / README.md
blob15bea2b90234e60c0667cce1cd682b15cbd6e7f2
1 # [React](https://facebook.github.io/react/) [![Build Status](https://img.shields.io/travis/facebook/react/master.svg?style=flat)](https://travis-ci.org/facebook/react) [![Coverage Status](https://img.shields.io/coveralls/facebook/react/master.svg?style=flat)](https://coveralls.io/github/facebook/react?branch=master) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests)
3 React is a JavaScript library for building user interfaces.
5 * **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.
6 * **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](https://facebook.github.io/react-native/).
7 * **Data flow:** React implements one-way reactive data flow which reduces boilerplate and is easier to reason about than traditional data binding.
9 **NEW**! Check out our newest project [React Native](https://github.com/facebook/react-native), which uses React and JavaScript to create native mobile apps.
11 [Learn how to use React in your own project](https://facebook.github.io/react/docs/getting-started.html).
13 ## Examples
15 We have several examples [on the website](https://facebook.github.io/react/). Here is the first one to get you started:
17 ```js
18 var HelloMessage = React.createClass({
19   render: function() {
20     return <div>Hello {this.props.name}</div>;
21   }
22 });
24 ReactDOM.render(
25   <HelloMessage name="John" />,
26   document.getElementById('container')
28 ```
30 This example will render "Hello John" into a container on the page.
32 You'll notice that we used an HTML-like syntax; [we call it JSX](https://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.
34 ## Installation
36 The fastest way to get started is to serve JavaScript from the CDN (also available on [cdnjs](https://cdnjs.com/libraries/react) and [jsdelivr](https://www.jsdelivr.com/projects/react)):
38 ```html
39 <!-- The core React library -->
40 <script src="https://fb.me/react-15.1.0.js"></script>
41 <!-- The ReactDOM Library -->
42 <script src="https://fb.me/react-dom-15.1.0.js"></script>
43 ```
45 We've also built a [starter kit](https://facebook.github.io/react/downloads/react-15.1.0.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.
47 If you'd like to use [bower](http://bower.io), it's as easy as:
49 ```sh
50 bower install --save react
51 ```
53 And it's just as easy with [npm](http://npmjs.com):
55 ```sh
56 npm i --save react
57 ```
59 ## Contribute
61 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.
63 ### Building Your Copy of React
65 The process to build `react.js` is built entirely on top of node.js, using many libraries you may already be familiar with.
67 #### Prerequisites
69 * You have `node` installed at v4.0.0+ and `npm` at v2.0.0+.
70 * You are familiar with `npm` and know whether or not you need to use `sudo` when installing packages globally.
71 * You are familiar with `git`.
73 #### Build
75 Once you have the repository cloned, building a copy of `react.js` is really easy.
77 ```sh
78 # grunt-cli is needed by grunt; you might have this installed already
79 npm install -g grunt-cli
80 npm install
81 grunt build
82 ```
84 At this point, you should now have a `build/` directory populated with everything you need to use React. The examples should all work.
86 ### Grunt
88 We use grunt to automate many tasks. Run `grunt -h` to see a mostly complete listing. The important ones to know:
90 ```sh
91 # Build and run tests with PhantomJS
92 grunt test
93 # Lint the code with ESLint
94 grunt lint
95 # Wipe out build directory
96 grunt clean
97 ```
99 ### Good First Bug
100 To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first bugs](https://github.com/facebook/react/labels/good%20first%20bug) that contain bugs which are fairly easy to fix.  This is a great place to get started.
103 ### License
105 React is [BSD licensed](./LICENSE). We also provide an additional [patent grant](./PATENTS).
107 React documentation is [Creative Commons licensed](./LICENSE-docs).
109 Examples provided in this repository and in the documentation are [separately licensed](./LICENSE-examples).
111 ### Moreā€¦
113 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](CONTRIBUTING.md).
115 ## Troubleshooting
116 See the [Troubleshooting Guide](https://github.com/facebook/react/wiki/Troubleshooting)