Question:- What were the major problems with MVC framework?
Answer:- The major problems with the MVC framework are: - DOM manipulation was very expensive. - It makes the application slow and inefficient. - There was a huge memory wastage. - It makes the application debugging hard.
Question:- What were the major problems with MVC framework?
Answer:- The major problems with the MVC framework are: - DOM manipulation was very expensive. - It makes the application slow and inefficient. - There was a huge memory wastage. - It makes the application debugging hard.
Question:- Explain the Flux concept.
Answer:- Flux is an application architecture that Facebook uses internally for building the client-side web application with React. It is neither a library nor a framework. It is a kind of architecture that complements React as view and follows the concept of Unidirectional Data Flow model. It is useful when the project has dynamic data, and we need to keep the data updated in an effective manner.
Question:- What is Redux?
Answer:- Redux is an open-source JavaScript library used to manage application state. React uses Redux for building the user interface. The Redux application is easy to test and can run in different environments showing consistent behavior. It was first introduced by Dan Abramov and Andrew Clark in 2015. React Redux is the official React binding for Redux. It allows React components to read data from a Redux Store, and dispatch Actions to the Store to update data. Redux helps apps to scale by providing a sensible way to manage state through a unidirectional data flow model. React Redux is conceptually simple. It subscribes to the Redux store, checks to see if the data which your component wants have changed, and re-renders your component.
Question:- What are the three principles that Redux follows?
Answer:- The three principles that redux follows are: 1. Single source of truth: The State of your entire application is stored in an object/state tree inside a single Store. The single State tree makes it easier to keep changes over time. It also makes it easier to debug or inspect the application. 2. The State is read-only: There is only one way to change the State is to emit an action, an object describing what happened. This principle ensures that neither the views nor the network callbacks can write directly to the State. 3. Changes are made with pure functions: To specify how actions transform the state tree, you need to write reducers (pure functions). Pure functions take the previous State and Action as a parameter and return a new State.
Question:- List down the components of Redux.
Answer:- he components of Redux are given below. - STORE: A Store is a place where the entire State of your application lists. It is like a brain responsible for all moving parts in Redux. - ACTION: It is an object which describes what happened. - REDUCER: It determines how the State will change.
Question:- Explain the role of Reducer.
Answer:- Reducers read the payloads from the actions and then updates the Store via the State accordingly. It is a pure function which returns a new state from the initial State. It returns the previous State as it is if no work needs to be done.
Question:- What is the significance of Store in Redux?
Answer:- A Store is an object which holds the applications State and provides methods to access the State, dispatch Actions and register listeners via subscribe(listener). The entire State tree of an application is saved in a single Store which makes the Redux simple and predictable. We can pass middleware to the Store which handles the processing of data as well as keep a log of various actions that change the Stores State. All the Actions return a new state via reducers.
Question:- What are the advantages of Redux?
Answer:- The main advantages of React Redux are: - React Redux is the official UI bindings for react Application. It is kept up-to-date with any API changes to ensure that your React components behave as expected. - It encourages good React architecture. - It implements many performance optimizations internally, which allows to components re-render only when it actually needs. - It makes the code maintenance easy. * Reduxs code written as functions which are small, pure, and isolated, which makes the code testable and independent.
Question:- How to access the Redux store outside a component?
Answer:- You need to export the Store from the module where it created with createStore() method. Also, you need to assure that it will not pollute the global window space.
Question:- What is Babel in React? a. Babel is a transpiler. b. Babel is an interpreter. c. Babel is a compiler. d. Babel is both a compiler and a transpiler.
Answer:- D is the correct option. Babel is both a compiler and a transpiler. It is used to include the ability to compile JSX into regular JavaScript. It is included in development mode and can also do many other powerful things.
Question:- What do you understand by the Reconciliation process in React? A. The Reconciliation process is a process through which React updates the DOM. B. The Reconciliation process is a process through which React deletes the DOM. C. The Reconciliation process is a process through which React updates and deletes the component. D. It is a process to set the state.
Answer:- A is the correct option. React uses a "diffing" algorithm that makes the component updates predictable and faster. The React first calculates the differences between the real DOM and the copy of DOM when it finds an update of components. Once it is finished calculating, the new update would be reflected on the real DOM.
Question:- Which of the following is used to pass data to a component from outside React applications? A. setState B. props C. render with arguments D. PropTypes
Answer:- B is the correct option. In React applications, props are used to pass data to a component from outside.
Question:- Which of the following function allows you to render React content on an HTML page? A. React.mount() B. React.start() C. React.render() D. React.render()
Answer:- C is the correct option. The ReactDOM.render() function is used to render React content in an HTML page.
