Question:- Explain the difference between visibility: hidden and display: none?
Answer:- visibility: hidden hides the element, but it occupies space and affects the layout of the document.
Question:- What do you understand by W3C?
Answer:- W3C stands for World Wide Web Consortium. Its purpose is to deliver the information of the World Wide Web. It also develops rules and guidelines for the Web.
Question:- What is tweening?
Answer:- It is the process of generating intermediate frames between two images. It gives the impression that the first image has smoothly evolved into the second one. It is an important method used in all types of animations. In CSS3, Transforms (matrix, translate, rotate, scale) module can be used to achieve tweening.
Question:- What is the difference between CSS2 and CSS3?
Answer:- The main difference between CSS2 and CSS3 is that CSS3 is divided into different sections which are also known as modules. Unlike CSS2, CSS3 modules are supported by many browsers.
Question:- What are the features of React?
Answer:- React framework gaining quick popularity as the best framework among web developers. The main features of React are: - JSX - Components - One-way Data Binding - Virtual DOM - Simplicity - Performance
Question:- What are the biggest limitations of React?
Answer:- Following is the list of the biggest limitations of React: - React is just a library. It is not a complete framework. - It has a huge library which takes time to understand. - It may be difficult for the new programmers to understand and code. - React uses inline templating and JSX, which may be difficult and act as a barrier. It also makes the coding complex.
Question:- What is JSX?
Answer:- JSX stands for JavaScript XML. It is a React extension which allows writing JavaScript code that looks similar to HTML. It makes HTML file easy to understand. The JSX file makes the React application robust and boosts its performance. JSX provides you to write XML-like syntax in the same file where you write JavaScript code, and then preprocessor (i.e., transpilers like Babel) transform these expressions into actual JavaScript code. Just like XML/HTML, JSX tags have a tag name, attributes, and children.
Question:- Why cant browsers read JSX?
Answer:- Browsers cannot read JSX directly because they can only understand JavaScript objects, and JSX is not a regular JavaScript object. Thus, we need to transform the JSX file into a JavaScript object using transpilers like Babel and then pass it to the browser.
Question:- Why we use JSX?
Answer:- - It is faster than regular JavaScript because it performs optimization while translating the code to JavaScript. - Instead of separating technologies by putting markup and logic in separate files, React uses components that contain both. - t is type-safe, and most of the errors can be found at compilation time. - It makes easier to create templates.
Question:- What do you understand by Virtual DOM?
Answer:- A Virtual DOM is a lightweight JavaScript object which is an in-memory representation of real DOM. It is an intermediary step between the render function being called and the displaying of elements on the screen. It is similar to a node tree which lists the elements, their attributes, and content as objects and their properties. The render function creates a node tree of the React components and then updates this node tree in response to the mutations in the data model caused by various actions done by the user or by the system.
Question:- Explain the working of Virtual DOM.
Answer:- Virtual DOM works in three steps: 1. Whenever any data changes in the React App, the entire UI is re-rendered in Virtual DOM representation. 2. Now, the difference between the previous DOM representation and the new DOM is calculated. 3. Once the calculations are completed, the real DOM updated with only those things which are changed.
Question:- What do you understand from "In React, everything is a component."
Answer:- In React, components are the building blocks of React applications. These components divide the entire React applications UI into small, independent, and reusable pieces of code. React renders each of these components independently without affecting the rest of the application UI. Hence, we can say that, in React, everything is a component.
Question:- What is Props?
Answer:- Props stand for "Properties" in React. They are read-only inputs to components. Props are an object which stores the value of attributes of a tag and work similar to the HTML attributes. It gives a way to pass data from the parent to the child components throughout the application. It is similar to function arguments and passed to the component in the same way as arguments passed in a function. Props are immutable so we cannot modify the props from inside the component. Inside the components, we can add attributes called props. These attributes are available in the component as this.props and can be used to render dynamic data in our render method.
Question:- What is a State in React?
Answer:- The State is an updatable structure which holds the data and information about the component. It may be changed over the lifetime of the component in response to user action or system event. It is the heart of the react component which determines the behavior of the component and how it will render. It must be kept as simple as possible.
