Google News
logo
React.js - Quiz(MCQ)
A)
Module
B)
Component
C)
Package
D)
Class

Correct Answer : Option (B) :   Component

A)
Inside js/components/
B)
Inside vendor/components/
C)
Inside vendor/components/
D)
Inside vendor/

Correct Answer : Option (A) :   Inside js/components/

A)
A transpiler.
B)
An interpreter
C)
A Compiler
D)
Both Compiler and Transpilar

Correct Answer : Option (D) :   Both Compiler and Transpilar

A)
1 Element
B)
2 Elements
C)
Multiple Elements
D)
None of the above

Correct Answer : Option (C) :   Multiple Elements

A)
A module bundler
B)
Runs react local development server.
C)
Transpiles all the Javascript down into one file
D)
None of the above

Correct Answer : Option (A) :   A module bundler

A)
Server-side Framework
B)
User-interface framework
C)
A Library for building interaction interfaces
D)
None of the Above

Correct Answer : Option (C) :   A Library for building interaction interfaces

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

Correct Answer : Option (D) :   All of these

A)
this.getState()
B)
this.prototype.stateValue
C)
this.state
D)
this.values

Correct Answer : Option (D) :   this.values

A)
Injected
B)
Methods
C)
Both A and B
D)
All of these

Correct Answer : Option (B) :   Methods

A)
getInitialState
B)
render
C)
renderComponent
D)
None of the Above

Correct Answer : Option (C) :   renderComponent

A)
3000
B)
3306
C)
8080
D)
None of the above

Correct Answer : Option (C) :   8080

A)
setState
B)
props
C)
PropTypes
D)
render with arguments

Correct Answer : Option (B) :   props


Explanation : Props are used to pass data to a component from outside

A)
Model
B)
Controller
C)
Router
D)
Middleware

Correct Answer : Option (B) :   Controller

A)
Virtual DOM
B)
Original DOM
C)
Both 1 & 2
D)
None of the above

Correct Answer : Option (A) :   Virtual DOM

A)
Unique in the DOM
B)
Do not requires to be unique
C)
Unique among the siblings only
D)
All of the above

Correct Answer : Option (C) :   Unique among the siblings only

A)
Dispatcher->Action->Store->View
B)
Action->Dispatcher->Store->View
C)
Action->Dispatcher->View->Store
D)
Action->Store->Dispatcher->View

Correct Answer : Option (B) :   Action->Dispatcher->Store->View

A)
Tim Lee
B)
Jordan Lee
C)
Jordan mike
D)
Jordan Walke

Correct Answer : Option (D) :   Jordan Walke

A)
Google
B)
Apple
C)
Facebook
D)
Twitter

Correct Answer : Option (C) :   Facebook

A)
JSX
B)
Flux
C)
Dom
D)
Props

Correct Answer : Option (B) :   Flux

A)
Initialization
B)
State/Property Updates
C)
Destruction
D)
All of these

Correct Answer : Option (D) :   All of these

A)
import React.Component from 'react'
B)
import [ Component ] from 'react'
C)
import Component from 'react'
D)
import { Component } from 'react'

Correct Answer : Option (D) :   import { Component } from 'react'

A)
Wrap it in the React.memo higher-order component.
B)
Implement the useReducer Hook.
C)
Implement the shouldComponentUpdate lifecycle method.
D)
Implement the useMemo Hook.

Correct Answer : Option (A) :   Wrap it in the React.memo higher-order component.

A)
Wrap the object in parentheses.
B)
Call the function from another file.
C)
Replace the with an array
D)
Add a return statement before the first curly brace.

Correct Answer : Option (A) :   Wrap the object in parentheses.

A)
stateful components
B)
class components
C)
math
D)
React Hooks

Correct Answer : Option (D) :   React Hooks

A)
{{name: "Venkat", age: 30}} 
B)
{name: "Venkat", age: 30} 
C)
{person: "Venkat", person: 30}} 
D)
{person: {name: "Venkat", age: 30}} 

Correct Answer : Option (B) :   {name: "Venkat", age: 30} 

A)
<h1>{fetch()}</h1> 
B)
<h1>${fetch()}</h1> 
C)
<h1>{fetch}</h1> 
D)
<h1>${fetch}</h1> 

Correct Answer : Option (A) :   <h1>{fetch()}</h1> 

A)
Error. Cannot use direct JavaScript code in JSX
B)
Error. Should be replaced with a for..loop for correct output
C)
Displays the list of languages in the array
D)
Displays nothing

Correct Answer : Option (C) :   Displays the list of languages in the array

A)
style={{font-size:12,color:'red'}} 
B)
style={{fontSize:'12px',color:'red'}} 
C)
style={fontSize:'12px',color:'red'} 
D)
style={{font-size:12px,color:'red'}} 

Correct Answer : Option (B) :   style={{fontSize:'12px',color:'red'}} 

A)
willComponentUpdate
B)
shouldComponentUpdate
C)
componentDidUpdate
D)
componentDidMount

Correct Answer : Option (B) :   shouldComponentUpdate

A)
Repetitive output appears on the screen
B)
Nothing happens. Life goes on!
C)
Duplicate key error
D)
Stack overflow error

Correct Answer : Option (D) :   Stack overflow error


Explanation : Call to setState() invokes render(). Calling it inside render is suicidal. It gets into an infinite loop

A)
Javascript library
B)
Javascript framework
C)
Both of above
D)
None of the above

Correct Answer : Option (A) :   Javascript library


Explanation : ReactJS is a javascript library for building user interfaces. its not a framework

A)
User Interface layer in an application
B)
Data layer in an application
C)
Both A and B
D)
None of the above

Correct Answer : Option (A) :   User Interface layer in an application


Explanation : ReactJS is a javascript library for building user interfaces. it covers only user interface layer of an application

A)
1
B)
2
C)
3
D)
4

Correct Answer : Option (A) :   1

A)
Be changed inside the component
B)
Not be changed in the component
C)
Be changed in side other component
D)
None of the above

Correct Answer : Option (B) :   Not be changed in the component

A)
Mocha
B)
Sinon
C)
Chai
D)
Jest

Correct Answer : Option (D) :   Jest

A)
Internal storage of the component
B)
A prement storage
C)
Both A and B
D)
None of the above

Correct Answer : Option (A) :   Internal storage of the component

A)
It will be rendered as disabled
B)
It will be rendered as enabled
C)
It will not be rendered at all
D)
None of the above

Correct Answer : Option (B) :   It will be rendered as enabled

A)
const first = ["cooking", "art", "history"] 
B)
const [] = ["cooking", "art", "history"] 
C)
const [, first]["cooking", "art", "history"] 
D)
const [first] = ["cooking", "art", "history"] 

Correct Answer : Option (D) :   const [first] = ["cooking", "art", "history"] 

A)
React Send
B)
React Pinpoint
C)
React Router
D)
React Context

Correct Answer : Option (D) :   React Context

A)
Horse
B)
Cat 
C)
Mouse
D)
None of the above

Correct Answer : Option (B) :   Cat 

A)
JSX Editor
B)
ReactDOM
C)
Browser Buddy
D)
Babel

Correct Answer : Option (D) :   Babel

A)
Component is created for the first time
B)
Component is created for the first time
C)
Both of above
D)
None of the above

Correct Answer : Option (C) :   Both of above

A)
Unique in the DOM
B)
Unique among the siblings only
C)
Do not requires to be unique
D)
None of the above

Correct Answer : Option (B) :   Unique among the siblings only

A)
Source of truth is DOM
B)
Source of truth is component state
C)
Source of truth can be anything
D)
None of the above

Correct Answer : Option (A) :   Source of truth is DOM

A)
when you want to replace Redux
B)
when you want to replace Redux
C)
when you want to break your production app
D)
when you want to improve performance

Correct Answer : Option (B) :   when you want to replace Redux

A)
any that have changed
B)
any that have not changed
C)
child props
D)
all of them

Correct Answer : Option (D) :   all of them

A)
This is a route modal
B)
This is a route parameter
C)
This is a route splitter
D)
This is a route link

Correct Answer : Option (B) :   This is a route parameter

A)
<h1 props={null}>What's happening?</h1>
B)
<h1>What's happening?</h1>
C)
<h1 id="component">What's happening?</h1>
D)
<h1 id="element">What's happening?</h1>

Correct Answer : Option (A) :  

<h1>What's happening?</h1>

A)
a
B)
b
C)
Both A and B
D)
None of the above

Correct Answer : Option (B) :   b

A)
state & props
B)
services & components
C)
state & services
D)
state & component

Correct Answer : Option (A) :   state & props

A)
a JS function
B)
a JS element
C)
a JSX wrapper
D)
a JS expression

Correct Answer : Option (D) :   a JS expression

A)
React.split
B)
React.lazy
C)
React.memo
D)
React.fallback

Correct Answer : Option (B) :   React.lazy

A)
to optimize for all devices
B)
to complete the update
C)
to change the layout of the screen
D)
when you need the browser to paint before the effect runs

Correct Answer : Option (D) :   when you need the browser to paint before the effect runs

A)
Add a render function
B)
Surround the h1 in a div.
C)
Move the h1 to another component.
D)
Change the curly braces to parentheses or add a return statement before the h1 tag.

Correct Answer : Option (D) :   Change the curly braces to parentheses or add a return statement before the h1 tag.

A)
declarative
B)
imperative
C)
integrated
D)
closed

Correct Answer : Option (A) :   declarative

A)
a property that lets you pass components as data to other components
B)
a property that lets you pass data to child elements
C)
a property that lets you set an array as a property
D)
a property that adds child components to state

Correct Answer : Option (A) :   a property that lets you pass components as data to other components

A)
because you should never mutate state
B)
because you want to allow data to flow back up to the parent
C)
because getDerivedStateFromProps() is an unsafe method to use
D)
because you want to allow a component to update in response to changes in the props 

Correct Answer : Option (D) :   because you want to allow a component to update in response to changes in the props 

A)
when you do not want your component to have state
B)
when you have sibling components that need to be compared
C)
when you want a default implementation of shouldComponentUpdate()
D)
when you do not want your component to have props

Correct Answer : Option (C) :   when you want a default implementation of shouldComponentUpdate()

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>; } 

Correct Answer : Option (B) :   function Dish({name, cookingTime}) { return <h1>{name} {cookingTime}</h1>; }  

A)
Button A will not have access to the event object on click of the button.
B)
Button B will not fire the handler this.handleClick successfully.
C)
Button A will not fire the handler this.handleClick successfully.
D)
There is no difference

Correct Answer : Option (B) :   Button B will not fire the handler this.handleClick successfully.

A)
error bosses
B)
error catchers
C)
error helpers
D)
error boundaries

Correct Answer : Option (D) :   error boundaries

A)
constructor
B)
componentDidMount
C)
componentWillReceiveProps
D)
componentWillMount

Correct Answer : Option (B) :   componentDidMount

A)
monads
B)
pure functions
C)
recursive functions
D)
higher-order functions

Correct Answer : Option (B) :   pure functions

A)
to directly access the DOM node 
B)
to refer to another JS file
C)
to bind the function
D)
to call a function

Correct Answer : Option (A) :   to directly access the DOM node 

A)
a computer property name
B)
a JSX code string
C)
a dynamic key
D)
a set value

Correct Answer : Option (C) :   a dynamic key

A)
Clock
B)
Component
C)
React.Component
D)
It does not have a name prop.

Correct Answer : Option (A) :   Clock

A)
React
B)
DOM
C)
ReactDOM
D)
Render

Correct Answer : Option (C) :   ReactDOM

A)
a callback function that is called once for each element in the array
B)
the name of another array to iterate over
C)
the number of times you want to call the function
D)
a string describing what the function should do

Correct Answer : Option (A) :   a callback function that is called once for each element in the array

A)
It is more functional than an object
B)
It automatically updates a component
C)
It makes sure that the object is not mutated
D)
setState is asynchronous and might result in out of sync values.

Correct Answer : Option (D) :   setState is asynchronous and might result in out of sync values.

A)
Use the value property
B)
Use the defaultValue property
C)
Use the default property
D)
It assigns one automatically

Correct Answer : Option (B) :   Use the defaultValue property

A)
useEffect(() => { setDone(true); });​
 
B)
useEffect(() => { setDone(true); }, []);
C)
useEffect(() => { setDone(true); }, [setDone]);
D)
useEffect(() => { setDone(true); }, [done, setDone]);

Correct Answer : Option (C) :  

useEffect(() => { setDone(true); }, [setDone]);

A)
<button onClick={(name) => this.hug(name)>Hug Button</button>
B)
<button onClick={this.hug(e, name)}>Hug Button</button>
C)
<button onClick={(e) => hug(e,name)}>Hug Button</button>
D)
<button onClick={(e) => this.hug(name, e)}>Hug Button</button>

Correct Answer : Option (A) :  

<button onClick={(name) => this.hug(name)>Hug Button</button>

A)
useEffect(function updateTitle() { document.title = name + ' ' + lastname; });
B)
useEffect(() => { title = name + ' ' + lastname; });
C)
useEffect(function updateTitle() { name + ' ' + lastname; });
D)
useEffect(function updateTitle() { title = name + ' ' + lastname; });

Correct Answer : Option (A) :  

useEffect(function updateTitle() { document.title = name + ' ' + lastname; });

A)
Remove this
B)
Capitalize clock
C)
Remove the render method
D)
Add quotes around the return value

Correct Answer : Option (B) :   Capitalize clock