React Questions March 16, 2023 | No Comments 0 votes, 0 avg 101 123456789101112131415 React Questions 1 / 15 1. Consider the following code from React Router. What do you call :id in the path prop? > Route path=”/:id” / > A. This is a route modal B. This is a route parameter C. This is a route splitter D. This is a route link 2 / 15 2. Which of the following is used in React.js to increase performance? A. Virtual Dom B. Original Dom C. Both A And b D. None of all 3 / 15 3. How do you destructure the properties that are sent to the Dish component? function Dish(props) { return ( {props.name} {props.cookingTime} ); A. function Dish([name, cookingTime]) { return <h1>{name} {cookingTime}</h1>; } B. function Dish({name, cookingTime}) { return <h1>{name} {cookingTime}</h1>; } C. function Dish(props) { return <h1>{name} {cookingTime}</h1>; } D. function Dish(…props) { return <h1>{name} {cookingTime}</h1>; } 4 / 15 4. What will be the output of the following code? import React, { Component } from 'react'; const App = () => { return( < div > < h1 className = "hello" > {25+20}< /h1 > < /div > ); } export default App; A. 25 B. 45 C. 35 D. none of these 5 / 15 5. What happens when the following render() method executes? render(){ let langs = ["PHP","ES6","JAVA"] return ( < div> {langs.map(it => < p > {it} < /p > )} < /div > ) } A. Error:cannot use direct javascript code in jsx B. error:should be replaced with a for..loop fo correct output C. display the list of language in the array D. displays nothing 6 / 15 6. What will happen if you render an input element with disabled = {false}? A. It will not be rendered at all B. It will be rendered as enabled C. It will be rendered as disabled D. All of the mentioned 7 / 15 7. What do you call a React component that catches JavaScript errors anywhere in the child component tree? A. error bosses B. error catchers C. error helper D. error boundaries 8 / 15 8. How many stages are there in React js life cycle A. 1 B. 2 C. 3 9 / 15 9. What is the use of React hooks? A. To manage state and side effects in functional components B. To manage styles in functional components C. To manage state and side effects in class components D. To manage styles in class components 10 / 15 10. How do you set a default value for an uncontrolled form field? A. Use the value property. B. Use the defaultValue property. C. Use the default property D. It assigns one automatically 11 / 15 11. What is the use of “webpack” command in React.js? A. The "webpack" command is used to transpile all the JavaScript down into one file. B. It is a module bundler. C. It runs React local development server. D. none of these 12 / 15 12. What are the limitations of ReactJS? A. React is only for view layer of the app so we still need the help of other technologies to get a complete tooling set for development B. React is using inline templating and JSX. This can seem awkward to some developers C. The library of react is too large D. All of these 13 / 15 13. Which of the following are the advantages of React.js? A. React.js is easy to integrate with other frameworks such as Angular, Backbone JS since it is only a view library B. React.js can render both on client and server side C. React.js can increase the application’s performance with Virtual DOM D. all of these 14 / 15 14. Which attribute is React’s replacement for using innerHTML in the browser DOM? A. injectHTML B. dangerouslySetInnerHTML C. weirdSetInnerHTML D. strangeHTML 15 / 15 15. React can only render elements in the root document element. A. true B. false Your score isThe average score is 42% LinkedIn Facebook VKontakte 0% Restart quiz By WordPress Quiz plugin Questions, Quiz