React.js Quiz | Set-3

    Last Updated :
    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")
    );
    • Component
    • This is Quiz Portal
    • Error in code
    • None of the above

    Question 2

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

    Question 3

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

    Question 4

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

    Question 5

    Which of the following is a way for webpack command to do in React.js?
    • Transpiles all of the javaScript into one
    • local development server
    • A and B are true
    • 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>;
     }
    }
    • Remove this
    • Capitalize date
    • Remove the render
    • The return value

    Question 7

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

    Question 8

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

    Question 9

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

    Question 10

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

    There are 15 questions to complete.

    Take a part in the ongoing discussion