React (software): Difference between revisions

Content deleted Content added
Adding/improving reference(s)
Tags: Visual edit Mobile edit Mobile web edit Advanced mobile edit
Renamed references using RefRenamer | Cleaned up using AutoEd, expanded contractions using script
Line 8:
{{Infobox software
| name = React
| logo = React_Logo_SVGReact Logo SVG.svg
| author = Jordan Walke
| developer = [[Meta Platforms|Meta]] and community
| released = {{Start date and age|2013|5|29}}<ref name="initialreleaseOcchino-2013">{{cite web|access-date=22 Oct 2018|first1=Tom|first2=Jordan|last1=Occhino|last2=Walke|title=JS Apps at Facebook|url=https://www.youtube.com/watch?v=GW0rj4sNH2w|website=YouTube|date=5 August 2013 |archive-date=31 May 2022|archive-url=https://web.archive.org/web/20220531133559/https://www.youtube.com/watch?v=GW0rj4sNH2w|url-status=live}}</ref>
| ver layout = stacked
| latest release version = {{wikidata|property|reference|edit|P348}}
Line 25:
}}
 
'''React''' (also known as '''React.js''' or '''ReactJS''') is a [[free and open-source software|free and open-source]] [[frontend and backend|front-end]] [[JavaScript library]]<ref name="reactreactjs.org-3">{{Cite web |title=React - A JavaScript library for building user interfaces. |url=https://reactjs.org |url-status=live |access-date=7 April 2018 |website=reactjs.org |language=en-US |archive-date=April 8, 2018 |archive-url=https://web.archive.org/web/20180408084010/https://reactjs.org/ }}</ref><ref>{{Cite web |title=Chapter 1. What Is React? - What React Is and Why It Matters [Book] |url=https://www.oreilly.com/library/view/what-react-is/9781491996744/ch01.html |url-status=live |access-date=2023-05-06 |website=www.oreilly.com |language=en |archive-date=May 6, 2023 |archive-url=https://web.archive.org/web/20230506100446/https://www.oreilly.com/library/view/what-react-is/9781491996744/ch01.html }}</ref> for building [[user interface|user interfaces]]s based on [[component-based software engineering|components]] by [[Facebook Inc]]. It is maintained by [[Meta Platforms|Meta]] (formerly Facebook) and a community of individual developers and companies.<ref>{{cite web |last=Krill |first=Paul |date=May 15, 2014 |title=React: Making faster, smoother UIs for data-driven Web apps |url=https://www.infoworld.com/article/2608181/javascript/react--making-faster--smoother-uis-for-data-driven-web-apps.html |access-date=2021-02-23 |website=[[InfoWorld]] |archive-date=2018-06-12 |archive-url=https://web.archive.org/web/20180612141516/https://www.infoworld.com/article/2608181/javascript/react--making-faster--smoother-uis-for-data-driven-web-apps.html |url-status=live }}</ref><ref>{{cite web |last=Hemel |first=Zef |date=June 3, 2013 |title=Facebook's React JavaScript User Interfaces Library Receives Mixed Reviews |url=https://www.infoq.com/news/2013/06/facebook-react |url-status=live |access-date=2022-01-11 |website=infoq.com |language=en-US |archive-url=https://web.archive.org/web/20220526082114/https://www.infoq.com/news/2013/06/facebook-react/ |archive-date=May 26, 2022}}</ref><ref>{{cite web |last=Dawson |first=Chris |date=July 25, 2014 |title=JavaScript's History and How it Led To ReactJS |url=https://thenewstack.io/javascripts-history-and-how-it-led-to-reactjs/ |url-status=live |access-date=2020-07-19 |website=The New Stack |language=en-US |archive-url=https://web.archive.org/web/20200806190027/https://thenewstack.io/javascripts-history-and-how-it-led-to-reactjs/ |archive-date=Aug 6, 2020 }}</ref>
 
React can be used to develop [[single-page application|single-page]], mobile, or [[server-side rendering|server-rendered]] applications with frameworks like [[Next.js]]. Because React is only concerned with the user interface and rendering components to the [[Document Object Model|DOM]], React applications often rely on [[JavaScript libraries|libraries]] for routing and other client-side functionality.{{sfn|Dere|2017}}{{sfn|Panchal|2022}} A key advantage of React is that it only rerenders those parts of the page that have changed, avoiding unnecessary re-rendering of unchanged DOM elements. It was first launched on 29 May 2013.<ref>{{Cite web |date=2021-04-12 |title=Is React a Library or a Framework? Here's Why it Matters |url=https://www.freecodecamp.org/news/is-react-a-library-or-a-framework/ |access-date=2024-10-12 |website=freeCodeCamp.org |language=en}}</ref>
 
== Notable features ==
=== Declarative ===
<ref>{{Cite web |date=2017-09-27 |title=React Introduction |url=https://www.geeksforgeeks.org/reactjs-introduction/ |access-date=2024-10-12 |website=GeeksforGeeks |language=en-US}}</ref>React adheres to the [[declarative programming]] [[Programming paradigm|paradigm]].{{sfn|Wieruch|2020}}{{rp|76}} Developers design views for each state of an application, and React updates and renders components when data changes. This is in contrast with [[imperative programming]].{{sfn|Schwarzmüller|2018}}
 
=== Components ===
React code is made of entities called [[Component-based software engineering|components]].{{sfn|Wieruch|2020}}{{rp|10-12}} These components are modular and reusable.{{sfn|Wieruch|2020}}{{rp|70}} React applications typically consist of many layers of components. The components are rendered to a root element in the [[Document Object Model|DOM]] using the React DOM library. When rendering a component, values are passed between components through ''props'' (short for "properties")''.'' Values internal to a component are called its ''state.''<ref>{{cite web |title=Components and Props |url=https://reactjs.org/docs/components-and-props.html#props-are-read-only |url-status=live |access-date=7 April 2018 |website=React |publisher=Facebook |archive-date=7 April 2018 |archive-url=https://web.archive.org/web/20180407120115/https://reactjs.org/docs/components-and-props.html}}</ref>
 
Line 52:
}}</ref> Hooks are functions that let developers "hook into" React state and lifecycle features from function components.<ref>{{Cite web|url=https://reactjs.org/docs/hooks-overview.html|title=Hooks at a Glance – React|website=reactjs.org|language=en|access-date=2019-08-08|archive-date=2023-03-15|archive-url=https://web.archive.org/web/20230315054047/https://reactjs.org/docs/hooks-overview.html|url-status=live}}</ref> Notably, Hooks do not work inside classes — they let developers use more features of React without classes.<ref>{{Cite web|url=https://blog.soshace.com/what-the-heck-is-react-hooks/|title=What the Heck is React Hooks?|date=2020-01-16|website=Soshace|language=en|access-date=2020-01-24|archive-date=2022-05-31|archive-url=https://web.archive.org/web/20220531133601/https://blog.soshace.com/what-the-heck-is-react-hooks/|url-status=live}}</ref>
 
React provides several built-in hooks such as <code>useState</code>,<ref>{{Cite web|url=https://reactjs.org/docs/hooks-state.html|title=Using the State Hook – React|website=reactjs.org|language=en|access-date=2020-01-24|archive-date=2022-07-30|archive-url=https://web.archive.org/web/20220730180312/https://reactjs.org/docs/hooks-state.html|url-status=live}}</ref>{{sfn|Larsen|2021}}{{rp|37}} <code>useContext</code>,{{sfn|Wieruch|2020}}{{rp|11}}<ref name=Larsen"reactjs.org-2">{{Cite web|url=https://reactjs.org/docs/hooks-state.html|title=Using the State Hook – React|website=reactjs.org|language=en|access-date=2020-01-24|archive-date=2022-07-30|archive-url=https://web.archive.org/web/20220730180312/https://reactjs.org/docs/hooks-state.html|url-status=live}}</ref>{{sfn|Larsen|2021}}{{rp|12}} <code>useReducer</code>,{{sfn|Wieruch|2020}}{{rp|92}}<ref name=Larsen"reactjs.org-2" />{{sfn|Larsen|2021}}{{rp|65-66}} <code>useMemo</code>{{sfn|Wieruch|2020}}{{rp|154}}<ref name=Larsen"reactjs.org-2" />{{sfn|Larsen|2021}}{{rp|162}} and <code>useEffect</code>.<ref>{{Cite web|url=https://reactjs.org/docs/hooks-effect.html|title=Using the Effect Hook – React|website=reactjs.org|language=en|access-date=2020-01-24|archive-date=2022-08-01|archive-url=https://web.archive.org/web/20220801212858/https://reactjs.org/docs/hooks-effect.html|url-status=live}}</ref>{{sfn|Larsen|2021}}{{rp|93-95}} Others are documented in the Hooks API Reference.<ref>{{Cite web|url=https://reactjs.org/docs/hooks-reference.html|title=Hooks API Reference – React|website=reactjs.org|language=en|access-date=2020-01-24|archive-date=2022-08-05|archive-url=https://web.archive.org/web/20220805061010/https://reactjs.org/docs/hooks-reference.html|url-status=live}}</ref>{{sfn|Wieruch|2020}}{{rp|62}} <code>useState</code> and <code>useEffect</code>, which are the most commonly used, are for controlling state{{sfn|Wieruch|2020}}{{rp|37}} and side effects,{{sfn|Wieruch|2020}}{{rp|61}} respectively.
 
==== Rules of hooks ====
There are two rules of hooks<ref>{{Cite web|url=https://reactjs.org/docs/hooks-rules.html|title=Rules of Hooks – React|website=reactjs.org|language=en|access-date=2020-01-24|archive-date=2021-06-06|archive-url=https://web.archive.org/web/20210606174151/https://reactjs.org/docs/hooks-rules.html|url-status=live}}</ref> which describe the characteristic code patterns that hooks rely on:
 
# "Only call hooks at the top level" — don'tdo not call hooks from inside loops, conditions, or nested statements so that the hooks are called in the same order each render.
# "Only call hooks from React functions" — don'tdo not call hooks from plain JavaScript functions so that stateful logic stays with the component.
 
Although these rules can'tcannot be enforced at runtime, code analysis tools such as [[Lint (software)|linters]] can be configured to detect many mistakes during development. The rules apply to both usage of Hooks and the implementation of custom Hooks,<ref>{{Cite web|url=https://reactjs.org/docs/hooks-custom.html|title=Building Your Own Hooks – React|website=reactjs.org|language=en|access-date=2020-01-24|archive-date=2022-07-17|archive-url=https://web.archive.org/web/20220717175155/https://reactjs.org/docs/hooks-custom.html|url-status=live}}</ref> which may call other Hooks.
 
=== Server components ===
Line 75:
</syntaxhighlight>
 
Currently, server components are most readily usable with [[Next.js]].
 
=== Class components ===
Line 90:
</syntaxhighlight>The introduction of React Hooks with React 16.8 in February 2019 allowed developers to manage state and lifecycle behaviors within functional components, reducing the reliance on class components.
 
This trend aligns with the broader industry movement towards functional programming and modular design. As React continues to evolve, it's is essential for developers to consider the benefits of functional components and React Hooks when building new applications or refactoring existing ones.<ref>{{Cite web |last=Chourasia |first=Rawnak |date=2023-03-08 |title=Convert Class Component to Function(Arrow) Component - React |url=https://codeparttime.com/convert-class-to-function-arrow-react/ |access-date=2023-08-15 |website=Code Part Time |archive-date=2023-08-15 |archive-url=https://web.archive.org/web/20230815131020/https://codeparttime.com/convert-class-to-function-arrow-react/ |url-status=live }}</ref>
 
=== Routing ===
React itself does not come with built-in support for [[routing]]. React is primarily a library for building user interfaces, and it doesn'tdoes not include a full-fledged routing solution out of the box. Third-party libraries can be used to handle routing in React applications.<ref>{{Cite web |date=2023-07-12 |title=Mastering React Router - The Ultimate Guide |url=https://www.devban.com/react-router-ultimate-guide/ |access-date=2023-07-26 |language=en-US |archive-date=2023-07-26 |archive-url=https://web.archive.org/web/20230726063450/https://www.devban.com/react-router-ultimate-guide/ |url-status=live }}</ref> It allows the developer to define routes, manage navigation, and handle URL changes in a React-friendly way.
 
[[File:VirtualDOM with respect to realDOM.png|thumb|There is a Virtual DOM that is used to implement the real DOM]]
 
=== Virtual DOM ===
Another notable feature is the use of a virtual [[Document Object Model]], or [[Virtual DOM]]. React creates an [[In-memory processing|in-memory]] data-structure cache, computes the resulting differences, and then updates the browser's displayed DOM efficiently.<ref name="workingwiththebrowserReact Blog">{{cite web |title=Refs and the DOM |url=https://reactjs.org/docs/refs-and-the-dom.html |access-date=2021-07-19 |website=React Blog |archive-date=2022-08-07 |archive-url=https://web.archive.org/web/20220807171328/https://reactjs.org/docs/refs-and-the-dom.html |url-status=live }}</ref> This process is called '''reconciliation'''. This allows the programmer to write code as if the entire page is rendered on each change, while React only renders the components that actually change. This selective rendering provides a major performance boost.<ref name=":0Codecademy">{{Cite web |title=React: The Virtual DOM |url=https://www.codecademy.com/articles/react-virtual-dom |access-date=2021-10-14 |website=Codecademy |language=en |archive-date=2021-10-28 |archive-url=https://web.archive.org/web/20211028172953/https://www.codecademy.com/articles/react-virtual-dom |url-status=live }}</ref>
 
== Updates ==
Line 107:
=== Lifecycle methods ===
Lifecycle methods for class-based components use a form of [[hooking]] that allows the execution of code at set points during a component's lifetime.
 
* <code>ShouldComponentUpdate</code> allows the developer to prevent unnecessary re-rendering of a component by returning false if a render is not required.
* <code>componentDidMount</code> is called once the component has "mounted" (the component has been created in the user interface, often by associating it with a [[Document Object Model|DOM]] node). This is commonly used to trigger data loading from a remote source via an [[API]].
* <code>componentDidUpdate</code> is invoked immediately after updating occurs.<ref>{{Cite web |title=React.Component – React |url=https://legacy.reactjs.org/docs/react-component.html |access-date=2024-04-09 |website=legacy.reactjs.org |language=en |archive-date=2024-04-09 |archive-url=https://web.archive.org/web/20240409075058/https://legacy.reactjs.org/docs/react-component.html |url-status=live }}</ref>
* <code>componentWillUnmount</code> is called immediately before the component is torn down or "unmounted". This is commonly used to clear resource-demanding dependencies to the component that will not simply be removed with the unmounting of the component (e.g., removing any <code>setInterval()</code> instances that are related to the component, or an "[[Event (computing)|eventListener]]" set on the "document" because of the presence of the component)
* <code>render</code> is the most important lifecycle method and the only required one in any component. It is usually called every time the component's state is updated, which should be reflected in the user interface.
 
=== JSX ===
{{Main|JSX (JavaScript)|l1=JSX}}
[[JSX (JavaScript)|JSX]], or JavaScript XML, is an extension to the JavaScript language syntax.<ref>{{cite web |date=2022-03-08 |title=Draft: JSX Specification |url=https://facebook.github.io/jsx/ |access-date=7 April 2018 |website=JSX |publisher=Facebook |language=en-US |archive-date=2022-04-02 |archive-url=https://web.archive.org/web/20220402072504/https://facebook.github.io/jsx/ |url-status=live }}</ref> Similar in appearance to HTML,{{sfn|Wieruch|2020}}{{rp|11}} JSX provides a way to structure component rendering using syntax familiar{{sfn|Wieruch|2020}}{{rp|15}} to many developers. React components are typically written using JSX, although they do not have to be (components may also be written in pure JavaScript). JSX is similar to another extension syntax created by Facebook for [[PHP]] called [[XHP]].
Line 133 ⟶ 132:
</syntaxhighlight>
 
=== Architecture beyond HTML ===
The basic [[Software architecture|architecture]] of React applies beyond rendering HTML in the browser. For example, Facebook has dynamic charts that render to <code><nowiki><canvas></nowiki></code> tags,<ref>{{cite web |last=Hunt |first=Pete |date=2013-06-05 |title=Why did we build React? – React Blog |url=https://facebook.github.io/react/blog/2013/06/05/why-react.html |access-date=2022-02-17 |website=reactjs.org |language=en-US |archive-date=2015-04-06 |archive-url=https://web.archive.org/web/20150406072833/http://facebook.github.io/react/blog/2013/06/05/why-react.html |url-status=dead }}</ref> and Netflix and [[PayPal]] use universal loading to render identical HTML on both the server and client.<ref name="paypalmedium.com-isomorphic-reactjs2015">{{cite web |date=2015-04-27 |title=PayPal Isomorphic React |url=https://medium.com/paypal-engineering/isomorphic-react-apps-with-react-engine-17dae662379c |url-status=live |archive-url=https://web.archive.org/web/20190208124143/https://www.paypal-engineering.com/2015/04/27/isomorphic-react-apps-with-react-engine/ |archive-date=2019-02-08 |access-date=2019-02-08 |website=medium.com}}</ref><ref name="netflixnetflixtechblog.com-isomorphic-reactjs2015">{{cite web |date=2015-01-28 |title=Netflix Isomorphic React |url=http://techblog.netflix.com/2015/01/netflix-likes-react.html |access-date=2022-02-14 |website=netflixtechblog.com |language=en-US |archive-date=2016-12-17 |archive-url=https://web.archive.org/web/20161217043150/http://techblog.netflix.com/2015/01/netflix-likes-react.html |url-status=live }}</ref>
 
=== Server-side rendering ===
Line 144 ⟶ 143:
React supports SSR, which allows developers to render React components on the server and send the resulting HTML to the client. This can be useful for improving the performance of the application, as well as for [[search engine optimization]] purposes.
 
== Common idioms ==
React does not attempt to provide a complete application library. It is designed specifically for building user interfaces<ref name="reactreactjs.org-3" /> and therefore does not include many of the tools some developers might consider necessary to build an application. This allows the choice of whichever libraries the developer prefers to accomplish tasks such as performing network access or local data storage. Common patterns of usage have emerged as the library matures.
 
=== Unidirectional data flow ===
To support React's concept of unidirectional data flow (which might be contrasted with [[AngularJS]]'s bidirectional flow), the Flux architecture was developed as an alternative to the popular [[model–view–controller]] architecture. Flux features ''actions'' which are sent through a central ''dispatcher'' to a ''store'', and changes to the store are propagated back to the view.<ref name="fluxFlux">{{cite web|url=https://facebook.github.io/flux/docs/in-depth-overview|title=In Depth OverView|publisher=Facebook|access-date=7 April 2018|website=Flux|archive-date=7 August 2022|archive-url=https://web.archive.org/web/20220807201252/https://facebook.github.io/flux/docs/in-depth-overview/|url-status=dead}}</ref> When used with React, this propagation is accomplished through component properties. Since its conception, Flux has been superseded by libraries such as [[Redux (JavaScript library)|Redux]] and MobX.<ref>{{cite web|title=Flux Release 4.0|url=https://github.com/facebook/flux/releases/tag/4.0.0|website=Github|access-date=26 February 2021|archive-date=31 May 2022|archive-url=https://web.archive.org/web/20220531133558/https://github.com/facebook/flux/releases/tag/4.0.0|url-status=live}}</ref>
 
Flux can be considered a variant of the [[observer pattern]].<ref>{{cite web|last1=Johnson|first1=Nicholas|title=Introduction to Flux - React Exercise|url=http://nicholasjohnson.com/react/course/exercises/flux/|website=Nicholas Johnson|access-date=7 April 2018|archive-date=31 May 2022|archive-url=https://web.archive.org/web/20220531133600/http://nicholasjohnson.com/react/course/exercises/flux/|url-status=live}}</ref>
 
A React component under the Flux architecture should not directly modify any props passed to it, but should be passed [[callback function]]s that create ''actions'' which are sent by the dispatcher to modify the store. The action is an object whose responsibility is to describe what has taken place: for example, an action describing one user "following" another might contain a user id, a target user id, and the type <code>USER_FOLLOWED_ANOTHER_USER</code>.<ref>{{cite web|last1=Abramov|first1=Dan|title=The History of React and Flux with Dan Abramov|url=http://threedevsandamaybe.com/the-history-of-react-and-flux-with-dan-abramov/|website=Three Devs and a Maybe|access-date=7 April 2018|archive-date=19 April 2018|archive-url=https://web.archive.org/web/20180419075905/http://threedevsandamaybe.com/the-history-of-react-and-flux-with-dan-abramov/|url-status=live}}</ref> The stores, which can be thought of as models, can alter themselves in response to actions received from the dispatcher.
 
This pattern is sometimes expressed as "properties flow down, actions flow up". Many implementations of Flux have been created since its inception, perhaps the most well-known being [[Redux (JavaScript library)|Redux]], which features a single store, often called a [[single source of truth]].<ref>{{cite web|title=State Management Tools - Results|url=http://2016.stateofjs.com/2016/statemanagement/|website=The State of JavaScript|access-date=29 October 2021|archive-date=31 May 2022|archive-url=https://web.archive.org/web/20220531133609/http://2016.stateofjs.com/2016/statemanagement/|url-status=live}}</ref>
 
In February 2019, <code>useReducer</code> was introduced as a [[React (web framework)#React Hooks|React hook]] in the 16.8 release. It provides an API that is consistent with Redux, enabling developers to create Redux-like stores that are local to component states.<ref>{{Cite web |url=https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#react-1 |title=React v16.8: The One with Hooks |access-date=2023-01-08 |archive-date=2023-01-08 |archive-url=https://web.archive.org/web/20230108090021/https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#react-1 |url-status=live }}</ref>
 
== Future development ==
Project status can be tracked via the core team discussion forum.<ref>{{Cite web|title = Meeting Notes|url = https://discuss.reactjs.org/c/meeting-notes|website = React Discuss|access-date = 2015-12-13|archive-date = 2015-12-22|archive-url = https://web.archive.org/web/20151222141426/https://discuss.reactjs.org/c/meeting-notes|url-status = dead}}</ref> However, major changes to React go through the Future of React repository issues and [[pull request]]s.<ref>{{Cite web|title = reactjs/react-future - The Future of React|url = https://github.com/reactjs/react-future|website = GitHub|access-date = 2015-12-13|archive-date = 2022-07-13|archive-url = https://web.archive.org/web/20220713230021/https://github.com/reactjs/react-future|url-status = live}}</ref><ref>{{Cite web|title = facebook/react - Feature request issues|url = https://github.com/facebook/react/labels/Type:%20Feature%20Request|website = GitHub|access-date = 2015-12-13|archive-date = 2022-07-09|archive-url = https://web.archive.org/web/20220709131412/https://github.com/facebook/react/labels/Type%3A%20Feature%20Request|url-status = live}}</ref> This enables the React community to provide feedback on new potential features, experimental APIs and JavaScript syntax improvements.
 
== History ==
React was created by Jordan Walke, a software engineer at [[Meta Platforms|Meta]], who initially developed a prototype called "F-Bolt"<ref name="How A Small Team of Developers Created React at Facebook | React.js: The DocumentaryYoutube-2023">{{cite web |title=React.js: The Documentary |url=https://youtube.com/watch?v=8pDqJVdNa44%3Fsi%3DFMJqegC4dPtwKP__&t=528 |website=Youtube | date=10 February 2023 |publisher=Honeypot |access-date=2024-05-27 |archive-date=2024-01-19 |archive-url=https://web.archive.org/web/20240119211307/https://www.youtube.com/watch?v=8pDqJVdNa44%3Fsi%3DFMJqegC4dPtwKP__&t=528 |url-status=live }}</ref> before later renaming it to "FaxJS". This early version is documented in Jordan Walke's GitHub repository.{{ref|Walke, Jordan. "FaxJS." GitHub. https://github.com/jordwalke/FaxJs. Accessed 11 July 2019.}} Influences for the project included [[XHP]], an [[HTML]] component library for [[PHP]].
 
React was first deployed on Facebook's [[News Feed]] in 2011 and subsequently integrated into [[Instagram]] in 2012 {{Citation needed|date=February 2024}}. In May 2013, at JSConf US, the project was officially open-sourced, marking a significant turning point in its adoption and growth.{{ref|Hámori, Emergent. "React - The Pragmatic Guide." 2022.}}
 
[[React Native]], which enables native [[Android (operating system)|Android]], [[iOS]], and [[Universal Windows Platform|UWP]] development with React, was announced at Facebook's React Conf in February 2015 and open-sourced in March 2015.
 
On April 18, 2017, Facebook announced React Fiber, a new set of internal algorithms for rendering, as opposed to React's old rendering algorithm, Stack.{{sfn|Lardinois|2017}} React Fiber was to become the foundation of any future improvements and feature development of the React library.<ref>{{cite web|title = React Fiber Architecture|url = https://github.com/acdlite/react-fiber-architecture|website = Github|access-date = 19 April 2017|archive-date = 10 May 2018|archive-url = https://web.archive.org/web/20180510140634/https://github.com/acdlite/react-fiber-architecture|url-status = live}}</ref>{{Update inline|reason=Last commit was in 2016. Is this statement still true?|date=June 2018}} The actual syntax for programming with React does not change; only the way that the syntax is executed has changed.<ref name="techcrunchTechCrunch-2017">{{cite web|url=https://techcrunch.com/2017/04/18/facebook-announces-react-fiber-a-rewrite-of-its-react-framework/|title=Facebook announces React Fiber, a rewrite of its React framework|website=TechCrunch|date=18 April 2017 |accessdate=2018-10-19|archive-date=2018-06-14|archive-url=https://web.archive.org/web/20180614172053/https://techcrunch.com/2017/04/18/facebook-announces-react-fiber-a-rewrite-of-its-react-framework/|url-status=live}}</ref> React's old rendering system, Stack, was developed at a time when the focus of the system on dynamic change was not understood. Stack was slow to draw complex animation, for example, trying to accomplish all of it in one chunk. Fiber breaks down animation into segments that can be spread out over multiple frames. Likewise, the structure of a page can be broken into segments that may be maintained and updated separately. JavaScript functions and virtual [[Document Object Model|DOM]] objects are called "fibers", and each can be operated and updated separately, allowing for smoother on-screen rendering.<ref name="github.com">{{cite web|url=https://github.com/acdlite/react-fiber-architecture|title=GitHub - acdlite/react-fiber-architecture: A description of React's new core algorithm, React Fiber|website=github.com|accessdate=2018-10-19|archive-date=2018-05-10|archive-url=https://web.archive.org/web/20180510140634/https://github.com/acdlite/react-fiber-architecture|url-status=live}}</ref>
 
On September 26, 2017, React 16.0 was released to the public.<ref>{{cite web
Line 183 ⟶ 182:
On August 10, 2020, the React team announced the first release candidate for React v17.0, notable as the first major release without major changes to the React developer-facing API.<ref>url=https://reactjs.org/blog/2020/08/10/react-v17-rc.html {{Webarchive|url=https://web.archive.org/web/20200810215037/https://reactjs.org/blog/2020/08/10/react-v17-rc.html |date=2020-08-10 }}</ref>
 
On March 29, 2022, React 18 was released which introduced a new concurrent renderer, automatic batching and support for server side rendering with Suspense.<ref name=":1reactjs.org" />
 
{| class="wikitable mw-collapsible mw-collapsed"
Line 214 ⟶ 213:
|0.10.0
|21 March 2014
|Added support for srcSet and textAnchor attributes, add update function for immutable data, Ensure all void elements don'tdo not insert a closing tag.
|-
|0.11.0
Line 326 ⟶ 325:
|16.10.0
|27 September 2019
|Fix edge case where a hook update wasn'twas not being memoized. Fix heuristic for determining when to hydrate, so we don'tdo not incorrectly hydrate during an update. Clear additional fiber fields during unmount to save memory. Fix bug with required text fields in Firefox. Prefer Object.is instead of inline polyfill, when available. Fix bug when mixing Suspense and error handling.
|-
|16.10.1
Line 342 ⟶ 341:
|16.12.0
|14 November 2019
|React DOM - Fix passive effects (<code>useEffect</code>) not being fired in a multi-root app. React Is - Fix <code>lazy</code> and <code>memo</code> types considered elements instead of components
|-
|16.13.0
Line 362 ⟶ 361:
|17.0.1
|22 October 2020
|React DOM - Fixes a crash in IE11
|-
|17.0.2
|22 March 2021
|React DOM - Remove an unused dependency to address the <code>SharedArrayBuffer</code> cross-origin isolation warning.
|-
|18.0.0
|29 March 2022
|Concurrent React, Automatic batching, New Suspense Features, Transitions, Client and Server Rendering APIs, New Strict Mode Behaviors, New Hooks <ref name=":1reactjs.org">{{cite web|title=React v18.0|url=https://reactjs.org/blog/2022/03/29/react-v18.html|website=reactjs.org|language=en|access-date=2022-04-12|archive-date=2022-03-29|archive-url=https://web.archive.org/web/20220329160934/https://reactjs.org/blog/2022/03/29/react-v18.html|url-status=live}}</ref>
|-
|18.1.0
Line 393 ⟶ 392:
|}
 
== Licensing ==
The initial public release of React in May 2013 used the [[Apache License 2.0]]. In October 2014, React 0.12.00 replaced this with the [[BSD licenses#3-clause|3-clause BSD license]] and added a separate PATENTS text file that permits usage of any Facebook patents related to the software:<ref>{{cite web|title=React CHANGELOG.md|url=https://github.com/facebook/react/blob/master/CHANGELOG.md#0120-october-28-2014|website=GitHub|access-date=2015-12-09|archive-date=2020-04-28|archive-url=https://web.archive.org/web/20200428042800/https://github.com/facebook/react/blob/master/CHANGELOG.md#0120-october-28-2014|url-status=live}}</ref><blockquote>The license granted hereunder will terminate, automatically and without notice, for anyone that makes any claim (including by filing any lawsuit, assertion or other action) alleging (a) direct, indirect, or contributory infringement or inducement to infringe any patent: (i) by Facebook or any of its subsidiaries or affiliates, whether or not such claim is related to the Software, (ii) by any party if such claim arises in whole or in part from any software, product or service of Facebook or any of its subsidiaries or affiliates, whether or not such claim is related to the Software, or (iii) by any party relating to the Software; or (b) that any right in any patent claim of Facebook is invalid or unenforceable.</blockquote>This unconventional clause caused some controversy and debate in the React user community, because it could 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.<ref>{{cite web|title=A compelling reason not to use ReactJS|first=Austin|last=Liu|url=https://medium.com/bits-and-pixels/a-compelling-reason-not-to-use-reactjs-beac24402f7b|website=Medium|access-date=2015-12-09|archive-date=2022-05-31|archive-url=https://web.archive.org/web/20220531133320/https://medium.com/bits-and-pixels/a-compelling-reason-not-to-use-reactjs-beac24402f7b|url-status=live}}</ref>
 
Line 406 ⟶ 405:
On September 26, 2017, React 16.0.0 was released with the MIT license.<ref>{{cite web |url=https://reactjs.org/blog/2017/09/26/react-v16.0.html#mit-licensed |title=React v16.0§MIT licensed |last=Clark |first=Andrew |date=September 26, 2017 |website=React Blog |access-date=October 18, 2017 |archive-date=October 3, 2017 |archive-url=https://web.archive.org/web/20171003031315/https://reactjs.org/blog/2017/09/26/react-v16.0.html#mit-licensed |url-status=live }}</ref> The MIT license change has also been backported to the 15.x release line with React 15.6.2.<ref>{{cite web |url=https://reactjs.org/blog/2017/09/25/react-v15.6.2.html |title=React v15.6.2 |last=Hunzaker |first=Nathan |date=September 25, 2017 |website=React Blog |access-date=October 18, 2017 |archive-date=May 31, 2022 |archive-url=https://web.archive.org/web/20220531133328/https://reactjs.org/blog/2017/09/25/react-v15.6.2.html |url-status=live }}</ref>
 
== See also ==
{{Portal|Free and open-source software}}
* [[Angular (web framework)]]
* [[Backbone.js]]
* [[Ember.js]]
* [[Gatsby (JavaScript framework)]]
* [[Next.js]]
* [[TypeScript]]
* [[Svelte]]
* [[Vue.js]]
* [[Comparison of JavaScript-based web frameworks]]
* [[Web Components]]
 
== References ==
{{Reflist|2}}
 
== Bibliography ==
{{Refbegin}}
* {{cite book |last=Larsen |first=John |title=React Hooks in Action With Suspense and Concurrent Mode |year=2021 |publisher=Manning |isbn=978-17200439971-72004-399-7}}
* {{cite book |last1=Schwarzmüller |first1=Max |date=2018-05-01 |title=React - The Complete Guide (incl. Hooks, React Router and Redux) |publisher=[[Packt Publishing]] |language=en-US}}
* {{cite book |last=Wieruch |first=Robin |title=The Road to React |publisher=Leanpub |isbn=978-17200439971-72004-399-7 |year=2020}}
* {{cite news |last=Dere |first=Mohan |date=2017-12-21 |title=How to integrate create-react-app with all the libraries you need to make a great app |language=en-US |work=freeCodeCamp |url=https://medium.freecodecamp.org/integrating-create-react-app-redux-react-router-redux-observable-bootstrap-altogether-216db97e89a3 |access-date=2018-06-14 }}
* {{cite news |last=Panchal |first=Krunal |date=2022-04-26 |title=Angular vs React Detailed Comparison |language=en-US |work=SitePoint |url=https://www.sitepoint.com/angular-vs-react/ |access-date=2023-06-05 |archive-date=2023-03-30 |archive-url=https://web.archive.org/web/20230330160838/https://www.sitepoint.com/angular-vs-react/ |url-status=live }}
* {{cite news |last1=Hámori |first1=Fenerec |title=The History of React.js on a Timeline |url=https://blog.risingstack.com/the-history-of-react-js-on-a-timeline/ |access-date=2023-06-05 |work=RisingStack |date=2022-05-31 |archive-date=2022-05-31 |archive-url=https://web.archive.org/web/20220531133616/https://blog.risingstack.com/the-history-of-react-js-on-a-timeline/ |url-status=live }}
* {{cite news |last=Lardinois |first=Frederic |title=Facebook announces React Fiber, a rewrite of its React library |url=https://www.infoworld.com/article/2608181/javascript/react--making-faster--smoother-uis-for-data-driven-web-apps.html |access-date=2023-06-05 |website=[[InfoWorld]] |archive-date=2018-06-12 |archive-url=https://web.archive.org/web/20180612141516/https://www.infoworld.com/article/2608181/javascript/react--making-faster--smoother-uis-for-data-driven-web-apps.html |url-status=live }}
{{Refend}}
 
== External links ==
* {{Official website}}
* [https://github.com/facebook/react Github]