10 Important things about React
React is not a Framework, it’s a Library
It is a common question that which one is better? Framework or Library? I support the Library. Because developers make Framework for a specific work. We cannot change it easily. But in the Library, we can take those parts of it, which we need. It is the main difference between Library and Framework.
React is not a Framework, it’s a Library. That’s why we can easily take the components we need and make an app according to our choice.
Props is an object in which properties are sent from its caller function. It helps us easily to send data from the parent component to the children component. But it will be suffering for passing data from a component to a component that is not its child component.
React App Performace Optimizing
There is some process to optimize the React app. Sometimes, our React app’s performance cannot be good for many causes. So, then we have to follow the optimizing rules to optimize our react app.
Document Object Model (DOM)
When the browser runs a web application, it makes a list of elements or components to run. Then it makes a tree and names the root is ‘Document’. Under this ‘Document’, there are many elements. And under this element, there are also many elements. Then the browser runs all serially maintaining the tree data structure.
React Virtual DOM
I have explained DOM previously. Now, I am going to talk about React virtual DOM. When React works, react makes a virtual DOM not to use the main DOM again and again. It helps us for running the web application better.
Props is an object in which properties are sent from its caller function. When the parent component doesn’t send anything and the children component wants to use it, then there will be an error. So, we can use default props to handle this type of error.
It is a great thing to share data from any component to any component. It is called an alternative solution for Redux. We can create it in the parent component and send the data from the parent component to other components using the provider. And only those components can use it, which are provided these.
It is a React special thing. We can save the state of a variable and can also update it by using the React state. If we use a normal variable, we cannot change it while rendering, but using state we can do it using the state function that is provided to update the state variable.
A markup language is used to make the UI. There is many mark up language. We can use HTML and XML for web UI, we can use XML Android app’s UI.
Props is an object in which properties are sent from its caller function. Sometimes we need to declare a type to prop, then we will use the PropTypes method. These type can be number, string, object etc.