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.
Question:- Which of the following shows the correct phases of the component lifecycle? A. Mounting: getDerivedStateFromProps(); Updating: componentWillUnmount(); Unmounting: shouldComponentUpdate() B. Mounting: componentWillUnmount(); Updating: render(); Unmounting: setState() C. Mounting: componentDidMount(); Updating: componentDidUpdate(); Unmounting: componentWillUnmount() D. Mounting: constructor(); Updating: getDerivedStateFromProps(); Unmounting: render()
Answer:- C is the correct option. React internally uses a concept of phases when applying changes to the DOM, including Render, Pre-Commit, and Commit. The componentDidMount(), componentDidUpdate(), componentWillUnmount() belongs to the "Commit" phase. Here is an interactive version, which shows each lifecycle method in each phase.
Question:- In MVC (Model, View, Controller) model, how can you specify the role of the React? A. React is the Middleware in MVC. B. React is the Controller in MVC. C. React is the Model in MVC. D. React is the Router in MVC.
Answer:- B is the correct option. React is the Controller in MVC.
Question:- What do the arbitrary inputs of components in React are called? A. Keys B. Props C. Elements D. Ref
Answer:- B is the correct option.
Question:- What do you understand by the "key" prop in React? A. "Key" prop is used to look pretty, and there is no benefit whatsoever. B. "Key" prop is a way for React to identify a newly added item in a list and compare it during the "diffing" algorithm. C. "Key" prop is one of the attributes in HTML. D. "Key" prop is NOT commonly used in the array.
Answer:- B is the correct option. "Key" prop is a way for React to identify a newly added item in a list and compare it during the "diffing" algorithm.
Question:- Which of the following is the correct data flow sequence of flux concept in React? A. Action->Dispatcher->View->Store B. Action->Dispatcher->Store->View C. Action->Store->Dispatcher->View D. None of the above.
Answer:- B is the correct option.
Question:- What do you understand by OOP?
Answer:- OOP stands for object-oriented programming. It is a programming paradigm that revolves around the object rather than function and procedure. In other words, it is an approach for developing applications that emphasize on objects. An object is a real word entity that contains data and code. It allows binding data and code together.
