If you are 6 months into React, then you must know what it actually is. That’s because among people who know programming, React is quite famous. React is a free and open-source library that’s used for creating user interfaces based on varying components. React was created by Jordan Walke. It was released in 2013.
Now, let’s move forward and see what are the concepts in React. But before that, keep in mind that React isn’t a framework. It’s actually a JavaScript library.
1. JSX Expressions
In React, if you want to mention JavaScript expressions, then you must use curly brackets. Further, expressions in React are actually used to evaluate and show dynamic values in JSX code. The expressions can be any: variables, functions, etc. Some benefits of using expressions in JSX are dynamic content, code reusability and conditional rendering.
2. Virtual DOM
React uses a virtual DOM. This is a concept in which ReactDOM maintains ideal representation in memory. Result? All this is kept in sync with the actual DOM. This is also called reconciliation. Further, all this also makes React’s declarative API possible. But wait, why is virtual DOM really fast? Well, virtual DOM is a copy of DOM. Further, since this is lightweight that’s why updates can be made faster and performance can be improved.
3. Properties in JSX
Object properties are termed as props in React. Why? Well, that’s because React elements are actually JavaScript objects. Further, props in React are read-only. This means that you can’t change the data after it’s been given to the component. You may think that this may be a downside. But actually it’s not. This can increase security and improve performance.
4. ReactJS Components
React applications are built using components. In other words, you can say that React’s building blocks are components. User-interface also becomes simple because of the use of components. React components are further divided into two categories: functional and class components.
5. Hooks in React
As the word suggests, hook hook into React state and lifecycle features. But ‘hook’ wasn’t present from the beginning in React. It was added to React 16.8 that was released in 2019.
Top comments (0)