• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
Switch to Dark Mode

React.js Quiz | Set-3

Last Updated : Apr 2, 2024
Discuss
Comments

Question 1

What is the output of the below code snippets ?
import React from 'react';
import ReactDOM from 'react-dom';
const Component=()=>
{
        return <h1>This is Quiz Portal</h1>
}
 
ReactDOM.render(
    <Component />,
    document.getElementById("root")
);
  • A
    Component
  • B
    This is Quiz Portal
  • C
    Error in code
  • D
    None of the above

Question 2

Which of the below expression is required to write the JSX ?
  • A
    {}
  • B
    []
  • C
    ""
  • D
    ()

Question 3

Which of the following is used to make data in-class components ?
  • A
    componentWillMount
  • B
    constructor
  • C
    componentDidMount
  • D
    componentWillReceiveProps

Question 4

What is the following is the use of ref in React.js ?
  • A
    for direct access to the DOM node
  • B
    for reference to another JS file
  • C
    for bind the function
  • D
    for calling a function

Question 5

Which of the following is a way for webpack command to do in React.js?
  • A
    Transpiles all of the javaScript into one
  • B
    local development server
  • C
    A and B are true
  • D
    None of the above

Question 6

Which of the following is needed to change the code for compilation?
class date extends React.Component {
 render() {
   return <h1>Todays Date is :  {this.props.date}</h1>;
 }
}
  • A
    Remove this
  • B
    Capitalize date
  • C
    Remove the render
  • D
    The return value

Question 7

What is the correct way to set the default value for uncontrolled components ?
  • A
    Value property
  • B
    DefaultValue property
  • C
    Default property
  • D
    Assigns automatically

Question 8

What happens when a property is assigned to a method ?
  • A
    get()
  • B
    destructor()
  • C
    constructor()
  • D
    init()

Question 9

Which of the following react components act like function with respect to props ?
  • A
    Recursive functions
  • B
    Monads
  • C
    Pure functions
  • D
    Higher-order functions

Question 10

Which of the following is true about the catch the JavaScript error ?
  • A
    error helpers
  • B
    error catchers
  • C
    error bosses
  • D
    error boundaries

Ready to go from coding beginner to development pro? Our DSA to Development Coding Guide has everything you need to crush coding interviews and ace real-world projects! Limited spots available!
Enroll Now and Transform Your Coding Skills! Also get 90% fee refund on completing 90% of the course in 90 days! Take the Three 90 Challenge today.

There are 15 questions to complete.

Take a part in the ongoing discussion

It seems that you are using an ad blocker.
Please disable it to support us!

Continue without supporting 😢