Dom Related Question You Must be Knowing This…

Arnobchakma
3 min readMay 7, 2021

1. What is dom?

The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the page so that programs can change the document structure, style, and content. It is an object-oriented representation of the web page, which can be modified with a scripting language such as JavaScript.

2. What is the Virtual DOM?

The virtual DOM (VDOM) is a programming concept where an ideal representation of a UI is kept in memory. In React world, the term “virtual DOM” is usually associated with React elements since they are the objects representing the user interface. They may also be considered a part of ‘Virtual Dom’ implementation in React.

3. What is React Fiber?

React Fiber is a completely backward-compatible rewrite of the old reconcile. It is the new reconciliation algorithm. Reconciliation is the process of comparing or diffing old trees with a new tree in order to find what is changed or modified.

4. What is a component lifecycle?

This world follows a cycle we are born, grow, and then die. React Components also follow this cycle. Components are created grow by updating, and then die. This is referred to as a component lifecycle.

5. What is React JSX?

JSX stands for JavaScript XML It allows us to write HTML in React. JSX provides us to write HTML/XML-like structures in the same file where we write JavaScript code then the preprocessor will transform these expressions into actual JavaScript code.

6. Why we used JSX?

There are many reasons why we should use JSX. Because?

  • It is faster than regular JavaScript because it performs optimization while translating the code to JavaScript.
  • It is type-safe, and most of the errors can be found at compilation time.
  • It makes easier to create templates.

7. What is React Props?

“Props” is a special keyword in React, which stands for properties and is being used for passing data from one component to another component.

  1. Firstly, it defines an attribute and its value(data).
  2. Then pass it to the child component by using Props.
  3. Finally, it renders the Props Data.

8. What is default Props in React?

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.

9. What is PropsType in react?

A React.js application is created by lots of components. These components get many specific attributes, just like an HTML tag. These attributes are called ”props” in React and can be also typed. We use prop-types to document the intended types of properties passed to components.

10. What is State in React?

React is the most popular front-end JavaScript library today. The React state is a built-in React object that is used to contain data or information about the component. When the state object changes, the component re-renders.

--

--