React (JavaScript library)

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
React.js logo
Original author(s) Jordan Walke
Developer(s) Facebook, Instagram and community
Initial release March 2013; 6 years ago (2013-03)
Stable release 15.1.0 / May 20, 2016; 3 years ago (2016-05-20)[1]
Development status Active
Written in JavaScript
Platform Cross-platform
Size 128 KiB production
559 KiB development
Type JavaScript library
License 3-Clause BSD with Facebook addendum (not OSI-approved)

React (sometimes styled React.js or ReactJS) is an open-source JavaScript library providing a view for data rendered as HTML. React views are typically rendered using components that contain additional components specified as custom HTML tags. React promises programmers a model in which subcomponents cannot directly affect enclosing components ("data flows down"); efficient updating of the HTML document when data changes; and a clean separation between components on a modern single-page application.

It is maintained by Facebook, Instagram and a community of individual developers and corporations.[2][3][4] According to JavaScript analytics service Libscore, React is currently being used on the homepages of Netflix, Imgur, Bleacher Report, Feedly, Airbnb, SeatGeek, HelloSign, and others.[5]

As of March 2016, React and React Native are Facebook's top two open-source projects by number of stars on GitHub,[6] and React is the 6th most starred project of all time on GitHub.[7]


React was created by Jordan Walke, a software engineer at Facebook. He was influenced by XHP, an HTML component framework for PHP.[8] It was first deployed on Facebook's newsfeed in 2011 and later on in 2012.[9] It was open-sourced at JSConf US in May 2013. React Native, which enables native iOS and Android development with React, was announced at Facebook's React.js Conf in February 2015 and open-sourced in March 2015.

Notable features

One-way data flow

Properties, a set of immutable values, are passed to a component's renderer as properties in its HTML tag. A component cannot directly modify any properties passed to it, but can be passed as callback functions that do modify values. This mechanism's promise is expressed as "properties flow down actions flow up".

For example, a shopping cart component might include multiple product line components. Rendering a product line uses only the properties passed to it and cannot affect the shopping cart's total due. However, the product line could be passed a callback function as a property which would be called when a 'delete this product' button was pushed and that callback function could affect the total due.

Virtual DOM

Another notable feature is the use of a "virtual DOM." React creates an in-memory data structure cache, computes the resulting differences, and then updates the browser's displayed DOM efficiently.[10] This allows the programmer to write code as if the entire page is rendered on each change while the React libraries only render subcomponents that actually change.

For example, a shopping cart component would be written to render the entire shopping cart on any change of data. If a product line subcomponent had no changes to the properties, a cached rendering would be used. This means the relatively slow full update to the browser's DOM would be avoided. Alternately, if the product line quantity had changed, the product line subcomponent would be rendered; the resulting HTML might differ in only one node, and only that node would be updated in the DOM.


React components are typically written in JSX, a JavaScript extension syntax allowing easy quoting of HTML and using HTML tag syntax to render subcomponents.[11] HTML syntax is processed into JavaScript calls of the React library. Developers may also write in pure JavaScript. JSX is similar to another extension syntax created by Facebook for PHP, XHP.

Architecture Beyond HTML

The basic architecture of React applies beyond rendering HTML in the browser. For example, Facebook has dynamic charts that render to <canvas> tags,[12] and Netflix and PayPal use isomorphic loading to render identical HTML on both the server and client.[13][14]

React Native

React Native libraries announced by Facebook in 2015 [15] provide the React architecture to native iOS and Android applications.

Future Development

Project status can be tracked via the core team discussion forum.[16] However major changes to React go through the Future of React repo, Issues and PR.[17][18] This enables the React community to provide feedback on new potential features, experimental APIs and JavaScript syntax improvements.

Sub Projects

The status of the React sub-projects is updated in the project wiki.[19]

Facebook CLA

In order to contribute to React or any Facebook FOSS project, one should fill the Facebook CLA.[20][21]

Patents clause controversy

The initial public release of React in May 2013 used a standard Apache License 2.0. In October 2014, React 0.12.0 replaced this with a 3-clause BSD license and added a separate PATENTS text file that permits usage of any Facebook patents related to the software.[22]

"The license granted hereunder will terminate, automatically and without notice, if you (or any of your subsidiaries, corporate affiliates or agents) initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software. [...] A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, or contributory infringement or inducement to infringe any patent, including a cross-claim or counterclaim."[23]

This unconventional clause caused some controversy and debate in the React user community, because it may be interpreted to empower Facebook to revoke the license in many scenarios, for example if Facebook sues the licensee prompting them to take "other action" by publishing the action on a blog or elsewhere. Many expressed concerns that Facebook could unfairly exploit the termination clause or that integrating React into a product might complicate a startup company's future acquisition.[24] At the time, Google reportedly forbade its employees from using any code under this license.[25]

Based on community feedback, Facebook updated the patent grant in April 2015 to be less ambiguous and more permissive.[26]


  1. "Releases - facebook/react". Github.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  2. "React: Making faster, smoother UIs for data-driven Web apps". InfoWorld.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  3. "Facebook's React JavaScript User Interfaces Library Receives Mixed Reviews". InfoQ.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  4. "JavaScript's History and How it Led To ReactJS". The New Stack.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  5. "Libscore".<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  6. "Open Source in 2015: A Year of Growth".<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  7. "GitHub search results sorted by number of stars".<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  8. "React (JS Library): How was the idea to develop React conceived and how many people worked on developing it and implementing it at Facebook?". Quora.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  9. "Pete Hunt at TXJS".<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  10. "Working With the Browser". React.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  11. "JSX in Depth". Retrieved 2015-11-17.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  13. "PayPal Isomorphic React".<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  14. "Netflix Isomorphic React".<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  16. "Meeting Notes". React Discuss. Retrieved 2015-12-13.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  17. "reactjs/react-future - The Future of React". GitHub. Retrieved 2015-12-13.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  18. "facebook/react - Feature request issues". GitHub. Retrieved 2015-12-13.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  19. "facebook/react Projects wiki". GitHub. Retrieved 2015-12-13.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  20. "facebook/react -". GitHub. Retrieved 2015-12-13.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  21. "Contributing to Facebook Projects". Facebook Code. Retrieved 2015-12-13.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  22. "React". GitHub.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  23. "Additional Grant of Patent Rights Version 2". GitHub.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  24. Liu, Austin. "A compelling reason not to use ReactJS". Medium.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  25. Hunter, Zellyn. "Hacker News: React Native is now open source". Y Combinator. Retrieved 9 December 2015.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  26. "Updating Our Open Source Patent Grant".<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>

External links