React JS MCQs 12
111. What is the purpose of the `useEffect` hook in React? a) To manage component state b) To perform side effects after every render (Cor...
111. What is the purpose of the `useEffect` hook in React? a) To manage component state b) To perform side effects after every render (Cor...
101. In React, which lifecycle method is called when a component is about to update? a) componentWillMount b) componentDidUpdate c) com...
What will be the output of the following React component? import React from 'react'; const MyComponent = () => { co...
Which of the following statements correctly imports React in a JSX file? a) import React from 'react'; (Correct Answer) b) re...
What is the purpose of the children prop in a React component? a) It represents the child components rendered inside the component (Corr...
What is the purpose of the useRef hook in React? a) To create references to DOM elements or React components (Correct Answer) b) To m...
In React, which method is called before the component is removed from the DOM? a) componentWillUnmount (Correct Answer) b) componentD...
Which of the following lifecycle methods is called only once, after the initial render? a) componentWillMount b) componentDidMount (C...
What is the purpose of the useRef hook in React? a) To create references to DOM elements or React components (Correct Answer) b) To m...
What is the purpose of the useCallback hook in React? a) To memoize functions so that they are not recreated on every render (Correct An...
What is the purpose of keys in React lists? a) To uniquely identify list items and help React identify which items have changed, added, ...
What is React JS? a) A JavaScript library for building user interfaces (Correct Answer) b) A server-side scripting language c) A r...
What is the purpose of the AVG() function in MySQL? A) To return the maximum value of a column B) To return the minimum value of a co...
What is the purpose of the IFNULL() function in MySQL? A) To check if a value is null B) To return the first non-null value in a list...
What is the purpose of the DATE_FORMAT() function in MySQL? A) To calculate the difference between two dates B) To return the current...
What is the purpose of the COUNT() function in MySQL? A) To return the number of rows in a table B) To calculate the total value of a...
What is the purpose of the NOW() function in MySQL? A) To return the current date and time B) To return the current date C) To ret...
What is the purpose of the CONCAT_WS() function in MySQL? A) To concatenate values from multiple rows into a single string B) To conc...
What is the purpose of the GROUP_CONCAT() function in MySQL? A) To calculate the average value of a numeric column B) To concatenate ...
What is the purpose of the JOIN keyword in MySQL? A) To perform aggregate functions on grouped data B) To filter rows based on a spec...