0% found this document useful (0 votes)
7 views

Final React js correct

The document contains a series of questions and answers related to React and Redux concepts, including hooks, state management, and component properties. It covers topics such as the purpose of various hooks (useRef, useMemo, useCallback), the differences between props and state, and the role of Redux functions like combineReducers and createStore. Additionally, it touches on the creation of React applications and the use of JSX.

Uploaded by

trapcloud8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
7 views

Final React js correct

The document contains a series of questions and answers related to React and Redux concepts, including hooks, state management, and component properties. It covers topics such as the purpose of various hooks (useRef, useMemo, useCallback), the differences between props and state, and the role of Redux functions like combineReducers and createStore. Additionally, it touches on the creation of React applications and the use of JSX.

Uploaded by

trapcloud8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 52
211125, 10:34 AM @ 9/150 sat tas Final-React-Test-R35 * hate ely eal! aeale ol sine *Lid 284222251387 " ‘What is the purpose of the connect function inRedux -1 To create anew store instance () v To connect a component to the store @) To create middleware for the store () ” ‘What is the purpose of the useRef hook in React -2 / v To access a mutable value that persists across renders ‘To manage component state O00 © ‘To manage component props ‘ntps:idocs.google.convformsid/ei1 FAlpQLSI/GYNgzkpxHimSLxNS80iécMmbtzG3yvkuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxeIAT.... 152 211125, 10:34 AM 1/1 Whatis the difference between React elements and React components -3. / 2in React There is no difference () React elements are plain objects that describe what to render, while React © components are functions or classes that produce React elements React components are plain objects that describe what to render, while React Oo elements are functions or classes that produce React components ‘What is the purpose of the useMemo hook in React -4 / Ww v To memoize a value, and recompute it only when its dependencies change @ ‘To manage component props (_) To manage component state () " ‘Which of the following are two ways to handle data in react -5 services and components () v State and props © state and services () state and component () -ntps:idocs.google.convformsid/eiFAIpQLSIGYNgzkpxHimSLxNS80iécMmbtzG3yvKuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxetAT.... 2152 21425, 10:24 AM 1/1 What is the purpose of the withRouter higher-order component in React -6 / Router To connect a component to the Redux store (_) To add authentication toa component (_) To pass routing props, such as match, location, and history, to a wrapped © ‘component a ‘What is used to handle code-splitting -7 v React.lazy ©) Reactmemo () React.split ©) React fallback () m ‘What is the purpose of the useCallback hook in React -8 / To manage component props () To manage component state (-) VY Tomemoize a function, and recompute it only when its dependencies change @) ‘ntps:idocs.google.convformsid/ei1FAlpQLSIGYNgzkpxHimSLaNS80i6cMmbtzG3yvkuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxeIAT.... 952 211125, 10:34 AM " ‘2Whatis the difference between props and state in React -9 There is no difference () Props are immutable, passed from parent to child components, wile states @ mutable, and managed within a component. State is immutable, passed from parent to child components, while props is Oo mutable, and managed within a component ‘What is the purpose of the useContext hook in React -10 / ” v To consume a context value that is provided by an ancestor component @) To manage component props. ©) To manage component state (.) 1/1 Whatis the difference between the action creator and the action in -11 / 7Redux There is no difference () An action creator is a function that creates an action, while an action is a plain © JavaScript object that describes a change in the state An action is a function that creates an action, while an action creator is a plain Oo JavaScript object that describes a change in the state -ntps:idocs.google.convformsid/eit FAIpQLSI/GYNgzkpxHimSLxNS80iécMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDxeIAT.... 452 211125, 10:34 AM 1/1 2What is the purpose of the combineReducers function in Redux -12 To create a new store instance v To combine multiple reducers into a single reducer function To create middleware for the store 1/1 2What is the difference between an action and a reducer in Redux -13 There is no difference Areducer is a plain JavaScript object that describes a change in the state, while an action is a function that takes the current state and an action, and returns anew state An action is a plain JavaScript object that describes a change in the state, while areducer is a function that takes the current state and an action, and returns a new state 1" ?Choose the library which is most often associated with react -14 Sinon v Jest Mocha Chai o@°o v OoO0@°0 -ntps:idocs.google.convformsid/eit FAlpQLSI/GYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxeIAT.... 5152 211125, 10:34 AM wn ‘What is the purpose of the Redux DevTools extension -15 v ‘To manage component props (_) To manage component state VY To provide a powerful debugging and inspection tool for Redux applications " 7How many elements can a valid react component return -16 v 1 2 3 4 1/1 Whatis the difference between the createStore function and the -17 2configureStore function in Redux There is no difference The createStore function is a low-level function for creating a store, while the configureStore function is a higher-level function that provides opinionated defaults and pre-configured middleware The configureStore function is a low-level function for creating a store, while the createStore function is a higher-level function that provides opinionated defaults and pre-configured middleware Oo (} v v Oo © oO -ntps:idocs.google.convformsid/eit FAIpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxeIAT.... 6152 211125, 10:34 AM " ‘2What is the purpose of the compose function in Redux -18 ‘To combine multiple reducers into a single reducer function () x To compose multiple functions, such as middleware and enhancers, into a © single function To create a new store instance () What is the difference between the bindActionCreators and the -19 / Ww 2useDispatch function in Redux V bindActionCreators is usedto bind action creators tothe dspatch function, while useDispatch is a hook that returns the dispatch function useDispatch is used to bind action creators to the dispatch function, while oO bindActionCreators is a hook that returns the dispatch function There is no difference () wn ‘What is the purpose of the redux-thunk middleware in Redux -20 / Dispatcher -> Store -> View @ Action > Dispatcher -> View > Store () Action-> Store > View > Dispatcher ) Dispatcher -> Action -> Store > View (_) w ‘What is the purpose of the useContext hook in React 46 / ‘To manage component props (_) To manage component state () v To share data between components without using props. @) a ‘What is the purpose of the useReducer hook in React 47 / To manage component props () v To manage complex state transitions and actions. @) To manage component state () ‘ntps:idocs.google.convformsid/ei1 FAlpQLSI/GYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDxetA... 16052 211125, 10:34 AM w 2Choose the method with refers to the parent class in ReactIS 48 / this) OQ super) © iniherits). CQ self) OC w JSX stands for-49 Javascript XML @ JSON XML ©) JSON ©) Javascript and AngularJS () 1/1 State whether true or false: React creates virtual DOM in memory -50 / Tue © False CQ) ‘ntps:idocs.google.convformsid/ei1FAIpQLSIGYNgzkpxHimSLaNS8OiécMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDxetA... 17152 211125, 10:34 AM m ‘Which company developed ReactUS -51 / Apple ©) v Facebook @ Google CQ) Twitter OQ) on What is the difference between the combineReducers and the -62 X ?reduceReducers functions in Redux There is no difference > combineReducers is used to combine multiple reducers into a single reducer function, while reduceReducers is used to combine multiple reducer functions into a single reducer function combineReducers is used to combine multiple reducer functions into a single reducer function, while reduceReducers is used to combine multiple reducers intoa () single reducer function m ‘Why is refused -53 to refer to another JS file to call a function to bind the function @ooo v to directly access the DOM node ‘ntps:idocs.google.convformsid/eit FAlpQLSI/GYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxetA... 18052 211125, 10:34 AM 1/1 Which method allows you to dispatch an action to change a state in 54 / your application A.getState ©) B.setState ©) v C.dispatch © D. subscribe () " What is the purpose of the createSlice function in Redux Toolkit 55 / To create a new store instance v To create a reducer function and action creators for a slice of state o@°o To create a middleware for the store m ‘Which of the following makes stores available -56 A.COMPONENT () B.CONTAINER () C.ACTIONS () v D. PROVIDER @ ‘ntps:idocs.google.convformsid/ei1 FAlpQLSIGYNgzkpxHimSLxNS80iécMmbtzG3yvkuSCSSCI5CTEXWXOWiewscoreviewscore=AEDZAGBDxetA... 19152 211125, 10:34 AM ntps:ildocs-google-convormsidle/F AlpQLSI/GY NgzkpxHimSLxNS@0iseMmbt2G3yvku3CS9GISC 18XWXQIviewscore lewscore=AEOZAgBOxetA. w w 1" Which of them provide us debugging platform for Redux apps -87 / A. Redux-Testing ©) B.Redux-Middleware () C. Redux-Devtools @) D. Redux-suscriber () ‘What is the purpose of the useEffect hook in React -58 ‘To manage component props (_) To manage component state () To perform a side effect after the component has been rendered @) ‘2What is the purpose of the useRef hook inReact -59 / To store a mutable value that persists across renders @) To manage component state () ‘To manage component props () 20182 211125, 10:34 AM ntps:ildocs-google-convormsidle/F AlpQLSI/GY NgzkpxHimSLxNS@0iseMmbt2G3yvku3CS9GISC 18XWXQIviewscore lewscore=AEOZAgBOxetA. w w " Pure functions are unpredictable -60 / A.TRUE ©) B.FALSE @ C. Can be true or false C) D.Cannotsay ©) Reducers are a pure function in Redux -61 A.TRUE © B.FALSE () C. Can be true or false () D.Cannot say ©) Redux can have store in your application 62 A.single © B.double (©) Cc. multi CQ D. None of the above (©) 21182 211125, 10:34 AM 11 Whatis the difference between a functional component and a class 63 / component in React There is no difference () /A functional component is a simple function that takes props as input and returns JSX, while a class component is a JavaScript class that extends © React.Component and has a render method Aclass component is a simple function that takes props as input and returns JSX, while a functional component is a JavaScript class that extends React.Component () and has a render method w Actions and states are held together by a function called -64 v ‘A. Reducer B. Redux C. suscribe D. view CoO00 © 1/1 Predictability of Redux is determined by most important -65 “principles ATwo v B. Three ©. Four OoO0@°0 D. Five -ntps:idocs.google.convformsid/eitFAIpQLSIGYNgzkpxHimSLxNS80i6cMmbtzG3yvkuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxetA... 22/52 211125, 10:34 AM wn 2Which of the following is true about React -66 / A. React is a JavaScript library for building user interfaces. B. React is used to build single page applications. C. React allows us to create reusable Ul components. @ooo v D. All of the above wn What is the difference between the connect function and the -67 2useSelector hook in Redux < There is no difference Oo \/ The connect function is used to connect a component to the store, while the useSelector hook is used to select a slice of state from the store © The useSelector hook is used to connect a component to the store, while the Oo connect function is used to select a slice of state from the store m 2In ES6, how many ways of defining your variables -68 v A3 © 3.4 O 5 O b6 O ‘ntps:idocs.google.convformsid/ei1FAlpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEVZAGBDretA... 2352 211125, 10:34 AM wn ‘What is the purpose of the useState hook in React -69 ‘To manage component props v ‘To manage component state To perform side effects, such as fetching data, after a component has rendered 1/1 What is the difference between the dispatch function and the getState -70 function in Redux There is no difference The dispatch function is used to dispatch actions to the store, while the getState function is used to get the current state of the store The getState function is used to dispatch actions to the store, while the dispatch function is used to get the current state of the store m What is Reacts -71 a) A server-side scripting language v b) A JavaScript library for building user interfaces c) A database management system d) An operating system v o@°0o v oO © OO0O@0 ‘ntps:idocs.google.convformsid/ei1 FAlpQLSI/GYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDretA... 2452 211125, 10:34 AM w w " Which of the following concepts is a key feature of React js-72 a) Two-way data binding ©) b) One-way data flow @ c) Three-way data synchronization () d) Four-way data communication (_) In React, what is JSX-73 / a) A file extension for JavaScript C) b) JavaScript XML, a syntax extension for JavaScript @) c) ACSS preprocessor (_) d) Apackage manager for React () Which of the following is used for handling state ina React-74 2component a) this.state CQ, b) this.setState) © ¢) this.props. ©) d) this.renderState(). ©) ntps:ildocs-google-convormsidle/F AlpQLSI/GY NgzkpxHimSLxNS@0iseMmbt2G3yvku3CS9GISC 18XWXQIviewscore lewscore=AEOZAgBOxetA. 25152 211125, 10:34 AM wn ‘2What is the Virtual DOM in React -75 / a) A physical representation of the web page b) An alternative to HTML v ©) Alightweight, in-memory representation of the actual DOM Oo@o00 4) A separate server used for rendering React components Ww Why is the Virlual DOM used in React js -76 < a) To replace the need for CSS. b) To manipulate the actual DOM directly v ¢) To improve performance by minimizing direct DOM manipulation d) To enhance security in web applications Oo@o0°0 w ‘What is a Single Page Application (SPA)-77 / v a) A website with a single HTML page that loads all content dynamically b) A website that uses multiple HTML pages for better performance ©) Awebsite with only one form for user input, O0O00 ®@ d) A website that doesn't use JavaScript ‘ntps:idocs.google.convformsid/eit FAIpQLSI/GYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDxetA... 26052 211125, 10:34 AM " ‘2What is the main purpose of the "state" in a React component -78 / a) To store data that doesn't change () b) To pass data between components (_) v c) To manage and track data that can change over time @) d) To style the component () 1/1 2Whatis the primary difference between "slate" and "props" in React -79 2) “State” is used for data that doesnt change, while "props" are used for data that) can change. '») 'State"is used for data that can change, while ‘props’ are used for passing @) data from parent to child components. c) "State" and "props" are interchangeable terms in React. () d) "State" and "props" both refer to external libraries used in React. () WW ‘7How do you update the state of a React component -80 / a) By directly modifying the "state" property (_) v b) By calling the "setState" method with the new data @) ¢) By using the "props" object C) 4) By using the “this.state()" function ©) ‘ntps:idocs.google.convformsid/eitFAIpQLSI/GYNgzkpxHimSLaNS8OiécMmbtzG3yvkuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxetA... 27152 211125, 10:34 AM w w w ‘In a functional component, how can you manage state -81 a) By using the setState method (©) b) By declaring a state variable using useState @) c) By modifying the state property directly C) d) By using the constructor method () Which type of component typically has a shorter and more concise 82 / syntax in React a) Functional component @) b) Class component () ¢) Both have similar syntax) ) It depends on the specific use case () In a functional component, how do you handle side effects, such as -83 fetching data or subscribing to a service a) Use the componentDidMount lifecycle method () b) Use the useEffect Hook @) c) Use the constructor method () d) Use the render method () ntps:ildocs-google-convormsidle/F AlpQLSI/GY NgzkpxHimSLxNS@0iseMmbt2G3yvku3CS9GISC 18XWXQIviewscore lewscore=AEOZAgBOxetA. 20152 211125, 10:34 AM What is Fetch in React used for -84 / m v a) To make network requests and retrieve data. @) b) To update the state of acomponent () c) To render components on the screen () d) To define component props (_) Mm ‘7How do you import Axios in a React component -85 v a) import axios from ‘axios’; b) import { Axios } from 'react-axos’ c) import { axios } from ‘react’ OOO © 4) import fetch from ‘axios; 1/1 Whatis the primary purpose of using asynchronous functions with -86 2Fetch and Axios in React a) To make the code cleaner and more organized. (_) b) To allow the user from interacting with the Ul while the request is being made. ©) v c) To ensure that the network request does not block the main thread. @) ) To handle file that may occur during the network request. () ‘ntps:idocs.google.convformsid/ei1 FAlpQLSIGYNgzkpxHimSLxNS80iécMmbtzG3yvkuSCSSGISCTEXWXOWiewscoreviewscore=AEDZAGBDxetA... 29052 211125, 10:34 AM mM Which of the following methods is used to handle a successful -87 response in an Axios request v a) then) b) catch) ©) finally) o0O0 © 4) success() 1/1_ In Fetch, how do you handle errors that may occur during a network -88 / request a) Using the .error() method b) Using a try-catch block v ) Using the .catch() method on the Promise returned by fetch() Oo@o°0 4) Fetch does not provide a way to handle errors. 1/1 In React, what happens if you omit the second argument (dependency 89 / array) when using the useEffect hook A) The effect runs only once after the initial render. () v B) The effect runs on every render. @ C) The component will not render. ©) D) An error is thrown. () ‘ntps:idocs.google.convformsid/ei1 FAlpQLSIGYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSCI5C1EXWXOWiewscoreviewscore=AEQZAGBDxetA... 30052 211125, 10:34 AM 1/1 ?Which of the following statements is true about the useState hook -20 / A) It can only be used in class components. v B) It can be used to manage both local and global state. ©) It is used for routing in React applications. OoO0@0 D) Itis deprecated and should not be used. 1/1 Which of the following hooks is used to clean up side effects in React -91 < A) use ffectCleanup B) useCleanupEffect ©) useCleanup @ooo v D) useEffect 1/1 What is the recommended way to update the state using the useState -92 YW hook when the new state depends on the previous state A) Use the setState method. () B) Use the state variable directly. ©) v ©) Use a callback function with the setState method. @) D) Update the state outside of the component. () ‘ntps:idocs.google.convformsid/ei1FAIpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvKuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDxetA... 31/52 211125, 10:34 AM mM 2What keyword is used to import modules in JavaScripReact -93 / port © b) require CQ) ©) include CQ) d)load CQ 1/1 Which of the following statements is true regarding module imports in -94 React a) You can import modules only from the same directory. () v b) You can import modules from any location on your file system. @) c) React does not support module imports. () d) Importing modules is only possible in class components. () 1/1 2Whatis the purpose of the ReactDOM.render() method in React -95 / a) To define React components. b) To create a new React application. v c) To render JSX elements into the DOM. Oo@o00 4) To import external libraries. ‘ntps:idocs.google.convformsid/ei1FAlpQLSIGYNgzkpxHimSLaNS80i6cMmbtzG3yvkuSCSSGI5CTEXWXOWiewscoreviewscore=AEQZAGBDxetA... 32/52 211125, 10:34 AM 1/1 7How can you include a JavaScript expression within JSX in React -96 / a) Enclose the expression in single curly braces: (expression) @) b) Use double curly braces: (( expression }} () ©) Use single quotes: '<% expression %>" CO) 4d) Use double quotes: "<% expression %>" ©) w ‘7What is the purpose of a React component's "render" method -97 / a) To update the component's state () b) To render the component's child components () ¢) To define the component's layout and UL @) d) To perform asynchronous operations () " can we use hooks in class component? - 98 ayes O B)no © ‘ntps:idocs.google.convformsid/eitFAlpQLSI/GYNgzkpxHimSLxNS8OiécMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEDZAGBDxetA... 33152 211125, 10:34 AM w 2What is a React component -99 / A.ACSS stylesheet ©) v B. A JavaScript function or class that defines Ul elements @ C.AnHTML element () D.ARedux action () w ‘Which of the following is a functional component in React -100 A. class MyComponent extends React.Component (_) v B. function MyComponent). @) C. const MyComponent = React.createClass(Q) ©) D. None of the above ©) 1/1 Which React Router component is used to wrap the application and -101 VY provide routing functionality ‘A. OC) B. ©) v C. @ D. ©) ‘ntps:idocs.google.convformsid/eit FAIpQLSIGYNgzkpxHimSLaNS8OiécMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDretA... 3452 211125, 10:34 AM w ‘What is the purpose of the useMemo hook in React -102, / v ‘To memoize a value, and recompute it only when its dependencies change @) To manage component props (_) To manage component state ©) None of the above () What is the purpose of the withRouter higher-order component in -103 / w ?React Router To connect a component to the Redux store () To add authentication to a component (_) OQ x B. © c. O D. 1/1 Whatis the difference between the action creator and the action in -106 / ?Redux There is no difference An action creator is a function that creates an action, while an action is a plain JavaScript object that describes a change in the state ‘An action is a function that creates an action, while an action creator is a plain JavaScript object that describes a change in the state oO @0 None of the above 1/1 2What is the purpose of the combineReducers function in Redux -107 / To create a new store instance v ‘To combine multiple reducers into a single reducer function To create middleware for the store OoO0@°0 None of the above ‘ntps:idocs.google.convformsid/ei1FAlpQLSIGYNgzkpxHimSLaNS80iécMmbtzG3yvKuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDretA... 36052 211125, 10:34 AM 1/1 How can you programmatically navigate to a different route in React -108 / Router ‘A.Use the component. () v B. Use the navigate function from the useHistory hook. @) C. Use the to prop of . (©) D. Use the redirectTo prop of . () " 2What type of value does useRef store -109 ¥ A. Immutable data. v B. Mutable data. ©. JSX elements. OoO0@°0 D. Function components. 1/1 2Whatis the difference between an action and a reducer in Redux -110 / There is no difference () A reducer is a plain JavaScript object that describes a change in the state, while an action is a function that takes the current state and an action, and returns anew =.) state An action is a plain JavaScript object that describes a change in the state, while areducer is a function that takes the current state and an action, andreturnsa @) new state None of the above (_) ‘ntps:idocs.google.convformsid/eit FAlpQLSIGYNgzkpxHimSLxNS80iécMmbtzG3yvKuSCSSCI5CTEXWXOWiewscoreviewscore=AEQZAGBDxetA... 37/52 211125, 10:34 AM wn ‘What is the purpose of the Redux DevTools extension -111 ¥ ‘To manage component props ‘To manage component state VY To provide a powerful debugging and inspection tool for Redux applications Oo@o0°0 None of the above 1/1 Whatis the difference between the createStore function and the -112 / 2configureStore function in Redux There is no difference The createStore function is a low-level function for creating a store, while the configureStore function is a higher-level function that provides opinionated defaults and pre-configured middleware The configureStore function is a low-level function for creating a store, while the createStore function is a higher-level function that provides opinionated defaults and pre-configured middleware None of the above 1/1 How do you access a specific query parameter named "page" using -113. / ?useSearchParams A. const page = useSearchParams.page; B. const params = useSearchParams.get(‘page); C. const params = useSearchParams(page’); @ooo v D. const page = useSearchParams().get(page); ‘ntps:idocs.google.convformsid/ei1 FAlpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSCI5C1EXWXOWiewscore?viewscore=AEDZAGBDretA... 38052 211125, 10:34 AM m When using useParams, how do you access a route parameter -114 / ?"named "id v A const {id}=useParams(); © B. const id = useParams(‘id’); ) C. const id = useParams().id; () value; () D. const id = useParams(‘d) " What is the purpose of the compose function in Redux -115 / ‘To combine multiple reducers into a single reducer function (.) \/ To compose multiple functions, such as middleware and enhancers, into a © single function To create anew store instance () None of the above () wn What is the difference between the bindActionCreators and the -116 2useDispatch function in Redux v bindActionCreators is used to bind action creators tothe dispatch function, @ while useDispatch is a hook that returns the dispatch function useDispatch is used to bind action creators to the dispatch function, while Oo bindActionCreators is a hook that returns the dispatch function There is no difference () None of the above () ‘ntps:idocs.google.convformsid/ei1FAIpQLSIGYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSGI5C1EXWXOWiewscore?viewscore=AEQZAGBDxetA... 39152 211125, 10:34 AM ntps:ildocs-google-convormsidle/F AlpQLSI/GY NgzkpxHimSLxNS@0iseMmbt2G3yvku3CS9GISC 18XWXQIviewscore lewscore=AEOZAgBOxetA. wn ‘What is the purpose of the redux-thunk middleware in Redux -117 / To allow action creators to return functions that can dispatch actions © " on asynchronously To manage component state () ‘To manage component props (_) None of the above (_) Which of the following is the correct way to conditionally run -118 / 7useEffect based on a specific prop change a) useEffect(() => { /* effect code */}, [props.myProp]) @ b) useEffect(() => (/* effect code */), [myProp]) C) c) useE ffect(() => { /* effect code */), [this.props.myProp]) () d) useEffect(() => (/* effect code */}, (1) OQ When is the useRef hook typically used to interact with DOM -119 X elements a) During the initial render of acomponent () b) After once component render @) c) Only when a component is unmounted () d) It cannot be used to interact with DOM elements) 40152 211125, 10:34 AM mM ‘2What is the purpose of the dispatch function in Redux -120 / A. To define the application's routes v B. To send actions to the store C. To create a new Redux store OoO0@0 D. To define the initial state of the application 1/1 ?Whatis the difference between the useReducer hook and Redux -121 / There is no difference useReducer is a simpler state management tool, while Redux is a more advanced state management tool V/ useReducer is a built-in state management tool in React, while Redux is a separate library for state management in React o@®@ 00 None of the above ” Which of the following hooks is used to trigger a re-render ofa -122 ¥ 2eomponent when its dependencies change v A) useEffect B) useMemo ©) useState OOO © D) useCallback ‘ntps:idocs.google.convformsid/eit FAlpQLSI/GYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDretA... 41152 211125, 10:34 AM ntps:ildocs-google-convormsidle/F AlpQLSI/GY NgzkpxHimSLxNS@0iseMmbt2G3yvku3CS9GISC 18XWXQIviewscore lewscore=AEOZAgBOxetA. w w " 2Which of the following is NOT a core concept inRedux -123 / A. Actions B. Reducers ©. Components Oo@o0°0 D. Store ‘2What is the purpose of the useSelector hook in Redux -124 / To select a slice of state from the store To create a new store instance To connect a component to the store OoOO0O0®@ None of the above What is the purpose of the component in React Router -125 / version 6 A. It defines the root outlet for the application. (-) B. It is used for creating named outlets in layouts. @) C. It specifies the path for a route. () D. Itis used for handling route transitions. () 42182 21125, 1034 aM w What is the difference between the dispatch function and the -126 ‘2getState function in Redux There is no difference () v The dispatch function is used to dispatch actions to the store, while the © getState function is used to get the current state of the store ‘The getState function is used to dispatch actions tothe store, while the dispatch) function is used to get the current state of the store None of the above () " Choose the correct data flow sequence of flux concept -127 ¥ Vv Action > Dispatcher-> Store-> View © Action > Dispatcher -> View-> Store () Action + Store-> View-> Dispatcher. Dispatcher -> Action -> Store -> View () wn ‘What is the purpose of the useReducer hook in React -128 To manage component props. ©) v To manage complex state transitions and actions. @) ‘To manage component state () None of the above (.) ‘ntps:idocs.google.convformsid/eit FAlpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSGI5CTEXWXOWiewscore?viewscore=AEQZAGBDretA... 43052 211125, 10:34 AM on What is the difference between the combineReducers and the -129 X ?reduceReducers functions in Redux There is no difference () X combineReducers is used to combine multiple reducers into a single reducer function, while reduceReducers is used to combine multiple reducer functions into a single reducer function combineReducers is used to combine multiple reducer functions into a single reducer function, while reduceReducers is used to combine multiple reducers into a single reducer function None of the above WW ‘What is Redux used for in a React application -130 / A. Handling routing v B. Managing state ©. Styling components OoO0@0O D. Making API requests 1/1, Which method allows you to dispatch an action to change a state in -131 ¥ your application A. getState B. setState v ©. dispatch Oo@o°0 D. subscribe ‘ntps:idocs.google.convformsid/eitFAlpQLSI/GYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSGISCTEXWXOWiewscore?viewscore=AEQZAGBDretA... 44052 211125, 10:34 AM mM What is the purpose of the Redux store -132 / A.To store API endpoints () v B. To manage the application's state @ C. To define the component structure () D. To control the application's routes.) w ‘Which of the following makes stores available -133 / A.component () B. container () C. actions () v D. provider @ 1/1 Which of them provide us debugging platform for Redux apps -134 VY A. Redux-Testing ©) B. Redux-Middleware () v C. Redux-Devtools @ D.Redux-suscriber ©) -ntps:idocs.google.convformsid/eit FAlpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSCI5CTEXWXOWiewscore?viewscore=AEDZAGBDretA... 45052 211125, 10:34 AM w ‘What is the purpose of the useRef hook in React -135 / To store a mutable value that persists across renders @) To manage component state () To manage component props © None of the above () w Reducers are a pure function in Redux -136 / A.TRUE © B.FALSE () C. Can be true or false () D.Cannot say ©) " Redux can have store in your application -137 A.single © B.double ©) Cc. multi CQ D. None of the above () ntps:idocs.google.convformsid/eit FAlpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSGI5CTEXWXOWiewscoreviewscore=AEQZAGBDretA... 46052 211125, 10:34 AM w ‘2Actions and states are held together by a function called -138 v A.Reducer © B.Redux ©) C. suscribe ©) D.view OQ. 1/1 Predictability of Redux is determined by most important -139 / -principles ATwo OC v B. Three @ c.Four ©) D.Five C) " What is the difference between the connect function and the -140 2useSelector hook in Redux There is no difference () The conneet function is used to connect a component tothe store, while the @) useSelector hook is used to select a slice of state from the store ‘The useSelector hook is used to connect a component to the store, while the Oo connect function is used to select a slice of state from the store None of the above () ‘ntps:idocs.google.convformsid/ei1FAlpQLSIGYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSCI5CTEXWXOWiewscore?viewscore=AEQZAGBDxetA... 47152 211125, 10:34 AM 1/1 How can you programmatically navigate to a different route in React -141 7 Router ‘A. Use the component. () v B. Use the navigate function from the useHistory hook. @) C. Use the to prop of . (©) D. Use the redirectTo prop of . (-) a 2What type of value does useRef store -142 Vv A. Immutable data. v B. Mutable data. C. JSX elements. OoO0@°0 D. Function components. 1/1 2What is the primary package used for routing in React applications -143 A) react-router-core v B) reactrouter-dom C) react-router-redux OoO0O@0 D) react-router-router ‘ntps:idocs.google.convformsid/eit FAlpQLSIGYNgzkpxHimSLaNS80igcMmbtzG3yvkuSCSSCI5CTEXWXOWiewscore?viewscore=AEDZAGBDretA... 48052 211125, 10:34 AM mM ‘2What does the second argument of useMemo specify -144 / A. The function to be memoized. v B, The dependencies array for memoization. C. The initial state value. OoO0O@°0 D. The rendering frequency. " To make a route match exactly, without any additional path -145 ‘segments, you use the exact prop. What does it do ‘A) Matches only when the route path contains a query parameter. v B) Matches only when the route path exactly matches the current URL. C) Matches only when the route is case-sensitive. OoO0@°0 D) Matches only when the route is inside a switch statement. 1/1 How do you access a specific query parameter named "page" using -146 2useSearchParams ‘A. const page = useSearchParams.page; B. const params = useSearchParams.get(page); C. const params = useSearchParams(page’); @©ooo0o v D. const page = useSearchParams().get'page); ‘ntps:idocs.google.convformsid/ei1FAIpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSGISCTEXWXOWiewscore?viewscore=AEQZAGBDretA... 49152 211125, 10:34 AM 11 When using useParams, how do you access a route parameter -147 / ?"named "id v A const {id}=useParams(); © B. const id = useParams(‘id’); ) C. const id = useParams().id; () D. const id = useParams(‘id’).value; () " What is the primary difference between useState and useRef in -148 ?React V/A. useState is used for managing component state, while useRefis used for @) rendering DOM elements. B, useState is used for rendering DOM elements, while useRef is used for managing component state. C. Both useState and useRef are used for managing component state. () D. useState and useRef are interchangeable and can be used for the same Oo purposes. w ‘What is used to handle code-splitting -149 Y v React.lazy © React.memo (©) React.split () React fallback () ‘ntps:idocs.google.convformsid/ei1FAlpQLSIGYNgzkpxHimSLxNS80iécMmbtzG3yvkuSCSSCI5C1EXWXOWiewscore?viewscore=AEQZAGBDxetA... 50/52 211125, 10:34 AM mM ‘What is the primary purpose of the useEffect hook in React -150 a) To declare state variables v b) To perform side effects in functional components c) To create reusable custom hooks OoO0@°0 d) To handle routing in React applications Google US ote! 5 tabi ht al aca seaSD aie Bess eg > £21 2Does this form look suspicious Google cite ‘ntps:idocs.google.convformsid/ei1FAIpQLSI/GYNgzkpxHimSLaNS80iécMmbtzG3yvkuSCSSCI5C1EXWXOWiewscore?viewscore=AEDZAGBDretA... S152 211125, 10:34 AM Fina-React-Test ROS ‘ntps:idocs.google.convformsid/ei1FAlpQLSIGYNgzkpxHimSLaNS8OigcMmbtzG3yvkuSCS9GISCTEXWXOWiewscore?viewscore=AEQZAGBDxetA... 52152

You might also like