Reactjs

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Explain Flux?

- Flux is an architectural pattern which enforces the uni-directional data flow. It controls derived data and enables communication between multiple components using a central Store which has authority for all data. Any update in data throughout the application must occur here only. Flux provides stability to the application and reduces run-time errors. - You can listen to as many stores as you like in your component. Stores allow components in deeper levels of components tree to get data directly. It simplifies the flow of data in your application. Since store data can change, there must be something which triggers the change. That's why Flux have the concept of actions. Stores subscribe to actions - everytime someone triggers the action, the registered store is notified about it.

List some of the major advantages of React?

1. It increases the application'a performance. 2. It can be conveniently used on the client as well as the server side. 3. Because of JSX, code's readability increases. 4. React is easy to integrate with other frameworks like Meteor, Angular, etc. 5. Using React, writing UI test cases become extremely easy.

What are the features of React?

1. It uses virtual DOM instead of real DOM. 2. It uses server-side rendering. 3. It follows uni-directional data flow or data binding.

What are the advantages of Redux?

1. Predictability of outcome 2. Maintainability 3. Server-side rendering 4. Developer tools 5. Community and ecosystem 6. Ease of testing 7. Organization

What is React?

1. React is a front end javascript library developed by Facebook in 2011. 2. It follows component based approach which helps in building reusable UI components. 3. It is used for developing complex and interactive web and mobile UI.

What are the limitations of React?

1. React is just a library, not a full blown framework 2. Its library is very large and takes time to understand. 3. It can be difficult for the novice programmers to understand. 4. Coding gets complex as it uses inline templating and JSX.

What do you understand about Virtual Dom?

1. Whenever any underlying data changes, the entire UI is re-rendered in Virtual DOM representation. 2. Then the difference between the previous DOM representation and the new one is calculated. 3. Once the calculations are done, the real DOM will be updated with only the things that have actually changed. 4. The representation of the UI is kept in memory and syncs with the real DOM. This process is called reconciliation.

List down the components of Redux.

Action - It's an object that describes what happened. Reducer - It is a place to determine how the state will change. Store - State/ Object tree of the entire application is saved in the Store. View - Simply displays the data provided by the Store.

Why can't browsers read JSX?

Browsers can only read Javascript objects but JSX in not a regular javascript object. Thus to enable a browser to read JSX, first, we need to transform JSX file into a javascript object using JSX transpilier and then pass it to the browser.

"In React, everything is a component." Explain.

Components are the building blocks of a React application's UI. These components split up the entire UI into small independent and reusable pieces. Then it renders each of these components independent of each other without affecting the rest of the UI.

What is the purpose of render() in React.

Each React component must have a render() mandatorily. It returns a single React element which is the representation of the native DOM component

What is an event in React?

In React, events are the triggered reactions to specific actions like mouse hover, mouse click, key press, etc. Handling these events are similar to handling events in DOM elements. But there are some syntactical differences like: - Events are named using camel case instead of just using the lowercase. - Events are passed as functions instead of strings.

What is JSX?

JSX is a shorthand for Javascript XML. This is a type of file used by React which utilizes the expressiveness of Javascript along with HTML like template syntax, increasing readability.

Difference between React and Angular?

React: Architecture: Only the view of MVC Rendering: Server-side rendering Dom: Uses virtual DOM Data Binding: One-way binding Debugging: Compile Time Debugging Author: Facebook Angular: Architecture: complete view of MVC Rendering: client-side rendering Dom: Uses Real DOM Data Binding: two-way binding Debugging: Runtime Debugging Author: Google

Differentiate between Real DOM and Virtual DOM?

Real DOM 1. It updates slowly. 2. Can directly update html. 3. Creates a new DOM if element updates. 4. DOM manipulation is very expensive. 5. Too much of memory wastage. Virtual DOM 1. It updates faster. 2. Can't directly update HTML. 3. Updates the JSX if element updates. 4. DOM manipulation is very easy. 5. No memory wastage.

What is a state in React and how is it used?

States are the heart of React components. States are the source of data and must be kept as simple as possible. Basically, states are the objects which determine components rendering and behavior. They are mutable unlike the props and create dynamic and interactive components. They are accessed via this.state().


संबंधित स्टडी सेट्स

Expresiones idiomáticas (Prueba 2)

View Set

Pediatric COMPREHENSIVE Practice Exam

View Set

3. Physics Practice Questions- Chapter 24

View Set

Chapter 42: Drugs Used to Treat Glaucoma and Other Eye Disorders

View Set

ITIL 4 Practitioner: Monitoring and Event Management

View Set

Programming Fundamentals I (Chapter 3)

View Set

AFLTA State Competition: Spanish Culture Bowl

View Set