Coding in react with JSX
React structure based on Components
React is a component-based library. In a way, we can define each part of the website as separate components and then design our website by putting the defined components together. Another important feature of the components is the possibility of reuse or reusability; Which helps us maintain code structure when working on larger projects.
One-way Data Binding design
React design is such that it follows the data flow in one direction. This feature allows for more and better control throughout the application. And in this regard, it has been able to help programmers a lot. As we said, data flow is defined in one-way react, but if we want to use the data in another direction, we must get help from another feature. And the reason for using components is their immutability and the data within them. If we want to keep the data one-sided, we use flux. Flux allows the program to be more flexible and efficient.
Virtual DOM in react
Before examining this feature of react, it is good to get acquainted with some basic terms. In order not to be confused in a more comprehensive explanation of this feature.
When the browser displays each html page, it generates a tree list of all the page components called the DOM list.
Check the Virtual DOM feature
Simply react style
Simplicity is due to two basic features. In fact, the JSX plugin and its component is the reason for the simplicity of react. Because it has the same coding capability as the html language, which is an understandable language, and the reusability approach of the program created using the components.
react is much more efficient than existing frameworks. And the reason for its good performance can be considered as Virtual DOM management. Because the DOM is completely in memory; But when we define a Component; The changes are not applied directly to the original DOM, but are first created on a virtual DOM. Then the two existing DOMs are compared and at the end each is the only change that is made to the original DOM. For this reason, it has been able to increase speed and have good performance.
Finally, the programmed react is developed and deserves its current position among programmers, given the key features and utilities it offers. And we can say that we have to wait for its development day by day and learn and become more reactive in the web world
- css conditional rules: when / else
- Which is better, flutter or react?