React.js Quiz | Set-2

Question 1
Which of the following is used to increase the performance of the React.js ?
Tick
Virtual DOM
Cross
Original DOM
Cross
Shallow DOM
Cross
Both of the above


Question 1-Explanation: 
Virtual Dom is a lightweight representation of the Document Object Model. The virtual DOM is used to increases the performance of React.js.
Question 2
Which of the following is the class-based component in React.js ?
Cross
class
Cross
factory
Cross
render
Tick
props


Question 2-Explanation: 
Props is the class-based component in React.js. It is used to transfer the data from the parent to the child component.
Question 3
Which of the following is true about the below syntax ?
disabled = {false} 
Cross
rendered as disabled
Cross
rendered at all
Tick
rendered as enabled
Cross
All of the above


Question 3-Explanation: 
From the above all option disabled = {false} the correct output is rendered as enabled.
Question 4

Which of the below category does react events come from ?

Cross

Destruction

Cross

Initialization

Cross

State/Property Updates

Tick

All of the above



Question 4-Explanation: 

The react event comes from the destruction, initialization, and State/Property Updates so all of the above options are correct.

Question 5

Which of the following is a way in which data get handled in React ?

Cross

state

Cross

props

Cross

model

Tick

A and B



Question 5-Explanation: 

The state and props are two ways in which data get handled in React.

Question 6
What is the output of the below code ?
var Geeks=(props)=>
{
 return(
 
DSA Course 1
DSA Course 2
); } ReactDOM.render(<DSA Course/>,mountNode)
Cross
DSA Course 1
Cross
DSA Course 2
Cross
DSA Course 1 DSA Course 2
Tick
Error


Question 6-Explanation: 
When we run the code and set the props then the ReactDom.render method shows the error in the code.
Question 7
Which of the following is called a message that is closed inside the curly braces?
const messages="Hii Geeks";
const element =<p>{messages}<p>
Cross
JS Function
Cross
JS Element
Tick
JS Expression
Cross
JSX Wrapper


Question 7-Explanation: 
The JS Expression is a message that is closed inside the curly braces.
Question 8
Which below hooks in React js allows to directly create a reference to the DOM element ?
Tick
useHook
Cross
useState
Cross
useEffect
Tick
useRef


Question 8-Explanation: 
The useRef in React JS direct creates the reference to the Dom element of the functional component. It contains the property called.
Question 9
Which of the following is the correct output of the below code. If a component is called Geeks and is rendered to another Dom which element will be rendered ?
function Geeks(){

return <h1> geeks For geeks </h1>
ReactDOM.render(,document.getElementById('root'));

}
Cross
div
Cross
section
Tick
h1
Cross
component


Question 9-Explanation: 
If a component is called Geeks and is rendered to another DOM h1 element will be rendered.
Question 10
Which of the below methods is used to render react content on an HTML page ?
Cross
React.mount()
Cross
ReactDOM.start()
Tick
ReactDOM.render()
Cross
React.render()


Question 10-Explanation: 
ReactDOM.render() methods is used to render react content on an HTML page.
There are 15 questions to complete.

  • Last Updated : 27 Sep, 2023

Share your thoughts in the comments
Similar Reads