idev0085 / react-boilerplate

0 stars 0 forks source link

MCQ assessment #84

Open idev0085 opened 3 years ago

idev0085 commented 3 years ago

What is true for the keys given to a list of elements in React? Unique among the siblings only.

What is the use of the create-react-app command in the React.js application? It is used to create a new React app.

In which of the following condition, the React.js Lifecycle method static getDerivedSateFromProps(props, state) is called? The component is created for the first time. The state of the component is updated.

Which of the following statement is true for uncontrolled components in React.js? The source of truth is DOM.

What changes would appear in the component as soon as the state of the React component is changed? It will re-render the component.

Which of the following statement is true for controlled components in React.js? The source of truth is a component state.

We can update the state in React.js by calling to setState() method. These calls are: Asynchronous in nature.

How can you set a default value for an uncontrolled form field? By using the defaultValue property

Which of the following method is not a part of ReactDOM ReactDOM. destroy() method is not a part of ReactDOM. ReactDOM provides the developers with an API containing the methods such as render(), findDOMNode(), unmountComponentAtNode(), hydrate(), and createPortal().

Which of the following best defines the "key" prop? "Key" prop is a way for React to identify a newly added item in a list and compare it during the "diffing" algorithm.

Why is the usage of setState? Invoke code after the setState operation is done.

Which of the following lifecycle events React components have at the highest level? Destruction Initialization State/Property Updates

Which of the following function is called to render HTML to the web page in React? ReactDOM.render()

Which of the following is not a disadvantage of React.js? The JSX in React.js makes code easy to read and write.

Which of the following command is used to install create-react-app? npm install -g create-react-app

What of the following is used in React.js to increase performance? Virtual DOM

A class is a type of function, but instead of using the keyword function to initiate it, which keyword do we use? Class

Which of the following acts as the input of a class-based component? Props

Which of the following keyword is used to create a class inheritance? Inherits

What would be the output of the following example? `var Helloword=(props)=> {
return(

Hello World 1
Hello World 2

);
}
ReactDOM.render(,mountNode) ` Error

What is the default port where webpack-server runs? 8080

How many numbers of elements a valid react component can return? 1

What is the declarative way to render a dynamic list of components based on values in an array? Using the Array.map() method

How many ways of defining your variables in ES6? 3

What is a state in React? Internal storage of the component.

What are the two ways to handle data in React? State & Props

In which of the following directory React.js components are saved? Inside the js/components/

Which of the following is a must API for every React.js component? renderComponent

Which of the following option is correct in the case of the Babel? Babel is a Compiler.

Does React.js create a VIRTUAL DOM in the memory? TRUE

What is the use of "webpack" command in React.js? It is a module bundler.

Which of the following is used to pass data to a component from outside in React.js? Props

What does ES6 stand for? ECMAScript 6

Which of the following method refers to the parent class in React.js? super()

What will happen if you render an input element with disabled = {false}? It will be rendered as enabled

What is ReactJs A Library for building interaction interfaces

What are props into other components Method

ReactJs cover User Interface layer in an application

Who is the father of React.js? Jordan Walke

React.js in MVC is Controller/View

What is state in react? Internal storage of the component

Everything in react is Component

At the highest level, React components have lifecycle events that fall into Destruction State/Property Updates Initialization

React component can return how many components multiple

Babel is Compiler Transpilar

Why we use webpack command? A module bundler

What are two ways that data gets handled in React? state props