Content deleted Content added
Undid revision 839430021 by Piyush96arora (talk) rv |
Lifecycle methods are important in ReactJS and without them, React would not know how and when to process any data at various points. I did not find it on this Wiki page, so I added it. |
||
Line 63:
Another notable feature is the use of a "virtual [[Document Object Model]]", or "virtual DOM". React creates an in-memory data structure cache,
computes the resulting differences, and then updates the browser's displayed DOM efficiently.<ref name=workingwiththebrowser>{{cite web |url=https://reactjs.org/docs/refs-and-the-dom.html |title=Refs and the DOM |website=React Blog}}</ref> This allows the programmer to write code as if the entire page is rendered on each change, while the React libraries only render sub components that actually change.
=== '''Lifecycle Methods''' ===
Lifecycle methods are various methods that come built in with ReactJS. They allow the developer to process data at various points in the lifecycle of a React app. For example
* shouldComponentUpdate is a lifecycle method that tells Javascript to update the component using a boolean variable.
* componentWillMount is a lifecycle method that tells Javascript to set up certain data before a component mounts (is inserted into the virtual DOM).
===JSX===
|