
Using ReactJS - Part 1
Share
Table of contents
###What is ReactJS?
It is a library created by Facebook, focused on the development for web UI components and their performance. It uses what they call "Virtual DOM", updating only parts of the DOM that changed without having to render the whole page or section of the page. This gives them an advantage in performance and rendering times, leaving behind other libraries as AngularJS.
React JS only provides tools for developing web components, but does not provide tools to make Ajax calls, nor events, nor promises, but that is OK, since we would only add the libraries needed, for example: SuperAgent, Kriskowal / q lodash, and AngularJS, which gives the option to do a wrap with the React components with an angular directive.
###How to use it?
React JS operates on classes for rendering HTML, you must first create a class of ract.
[prism:javascript]
var HelloWorld = React.createClass({
render: function() {
return
;
}
});
React.render(new HelloWorld(), document.body);
[/prism:javascript]
The other way to handle variables within the components react are the state, like props any change to a state will cause the component to again, but this time only if the setstate method is used as we see in the increment class method HelloWorld otherwise, no changes will be made to the state; What should I use, props or state? for attributes of sight, as information to be displayed to the user or an icon, use state; if a variable flow control or not related directly to the view, use props or private variables, if the prop is not inherited from a parent view.
ReactJS provides a number of listeners that can override in each class to have control of it is rendered and when rendered, or if we want to be renderize based on any state property or private variable, these methods are:
Hello, {this.props.name}!
;
}
});
React.render(new HelloWorld({ name: "Yohendry Hurtado" }), document.body);
[/prism:javascript]
Here we can see this line : [prism:javascript] return Hello, {this.props.name}!
; [/prism:javascript]
this.props, is an object with all the properties that are assigned when instantiating the component, these properties are the way in which react send the information to the components, as we can see here [prism:javascript]React.render(new HelloWorld({ name: "Yohendry Hurtado" }), document.body);[/prism:javascript] where we change the property name to the HellowWorld component. Any changes to these properties will update the view, as mentioned earlier only where really changed, these changes can come from parents or children view components (nested views).
[prism:javascript]
var HelloWorld = React.createClass({
getInitialState: function() {
return {
counter: 0
};
},
increment: function() {
this.setState({ counter: this.state.counter+1 });
},
render: function() {
return {this.state.counter}
- componentWillMountt - runs before rendering first component
- componentDidMount - It runs just after rendering first component
- componentWillUpdate - runs before upgrading the component, if you return false in this listener, you prevent component update
- componentDidUpdate - It runs to update the component
- componentWillUnmount- It executes before destroying a component
Related blogs

Best Machine Learning and Data Science Software: Technical Guide 2026
January 7th 2026
Looking for machine learning software? We analyze the best tools (TensorFlow, Vertex AI, Databricks) from a business development perspective.

Data Science and Machine Learning: Unlocking its benefits
January 6th 2026
Discover how Rootstack applies data science, AI, and ML to transform your business. Explore the benefits of machine learning and real-world use cases.

Things to consider when selecting Nearshore Partner
January 4th 2026
Developing a software is a complex, time-consuming and usually expensive task. Choosing to outsource part of the entire development team to a nearshore development partner can be a wise choice. Not only because it is relatively affordable and cost-effective, but because it offers a new set of benefits for growing business that are looking to expand their reach.

Open banking vs. open finance: platforms, APIs, and use cases
December 17th 2025
Discover the differences between open banking and open finance. Learn about platforms, bank account APIs, and use cases to scale your fintech business

Embedded Fintech: Payments, Investment, and APIs that drive growth
December 17th 2025
At Rootstack, we understand that adopting these technologies isn't just a software update; it's a business model evolution. In this article, we'll explore how the right infrastructure—from payments to robust APIs—can catalyze sustainable growth

AI in Fintech: Use cases and practical applications of artificial intelligence in banking and finance
December 17th 2025
Throughout this article, we will explore how AI in banking and finance is reshaping the ecosystem, what the most profitable use cases are, and why having a specialized technical partner is vital for successful deployment