React.js- You must know before starting React
Conditional rendering is a term to describe the ability to render different user interface (UI) markup if a condition is true or false. In React, it allows us to render different elements or components based.
defaultProps is a property in React component used to set default values for the props argument. It will be changed if the prop property is passed.
The DOM represents a document with a logical tree. The react-dom package provides DOM-specific methods that can be used at the top level of our app.
Components vs Elements:
An element is defined as something basic that isn’t made up of constituent parts that it could be further broken down into. A component simply means a part of something, and could be an element or could be something more complex. A React Component is a template. A blueprint. A global definition. This can be either a function or a class.
React components has a built-in state object. The state object is where you store property values that belong to the component. When the state object changes, the component re-renders.
Functions vs classes:
Functions do specific things, classes are specific things. Classes often have methods, which are functions that are associated with a particular class, and do things associated with the thing that the class is but if all we want is to do something, a function is all we need.
Nesting React elements:
In React, we can nest components inside within one another. This helps in creating more complex User Interfaces. The components that are nested inside parent components are called child components. Import and Export keywords facilitate the nesting of the components.
Instead of working with strings to represent DOM elements in React, we represent DOM elements with objects using calls to the React.createElement method.