MCQs > IT & Programming > React.js MCQs > Basic React.js MCQs

Basic React.js MCQ

1. What pattern is being used in this code? const { tree, lake } = nature;

Answer

Correct Answer: Destructuring assignment

Note: This Question is unanswered, help us to find answer for this one

2. Why might you use a React.ref?

Answer

Correct Answer: To directly access the DOM node

Note: This Question is unanswered, help us to find answer for this one

3. When using the React Developer Tools Chrome extension, what does it mean if the React icon is red?

Answer

Correct Answer: You are using the development build of React.

Note: This Question is unanswered, help us to find answer for this one

4. What might you use webpack for?

Answer

Correct Answer: To split your app into smaller chunks that can be more easily loaded by the browser

Note: This Question is unanswered, help us to find answer for this one

5. When does the componentDidMount function fire?

Answer

Correct Answer: Right after the component is added to the DOM

Note: This Question is unanswered, help us to find answer for this one

6. You want to disable a button so that it does not emit any events onClick. Which prop do you use to acomplish this?

Answer

Correct Answer: Disabled

Note: This Question is unanswered, help us to find answer for this one

7. What syntax do you use to create a component in React?

Answer

Correct Answer: A function or a class

Note: This Question is unanswered, help us to find answer for this one

8. How might you check property types without using Flow or TypeScript?

Answer

Correct Answer: Use prop-types.

Note: This Question is unanswered, help us to find answer for this one

9. What is the JavaScript syntax extension that is commonly used to create React elements?

Answer

Correct Answer: JSX

Note: This Question is unanswered, help us to find answer for this one

10. Which tool is not part of Create React App?

Answer

Correct Answer: JQuery

Note: This Question is unanswered, help us to find answer for this one

11. What is the browser extension called that React developers use to debug applications?

Answer

Correct Answer: React Developer Tools

Note: This Question is unanswered, help us to find answer for this one

12. What command can you use to generate a React project?

Answer

Correct Answer: Create-react-app

Note: This Question is unanswered, help us to find answer for this one

13. React is an open-source project but is maintained by which company?

Answer

Correct Answer: Facebook

Note: This Question is unanswered, help us to find answer for this one

14. What is the process of deciding whether an update is necessary?

Answer

Correct Answer: Reconciliation

Note: This Question is unanswered, help us to find answer for this one

15. You are rendering a list with React when this warning appears in the console: "Warning: Each child in a list should have a unique 'key' prop." How do you fix this issue?

Answer

Correct Answer: When iterating over the list items, add a unique property to each list item.

Note: This Question is unanswered, help us to find answer for this one

16. What is the first file loaded by the browser in a basic React project?

Answer

Correct Answer: Public/index.html

Note: This Question is unanswered, help us to find answer for this one

17. When using a portal, what is the second argument?ReactDOM.createPortal(x, y);

Answer

Correct Answer: The DOM element that exists outside of the parent component

Note: This Question is unanswered, help us to find answer for this one

18. What is setCount? const [count, setCount] = useState(0);

Answer

Correct Answer: A function to update the state

Note: This Question is unanswered, help us to find answer for this one

19. When using a portal, what is the first argument? ReactDOM.createPortal(x, y);

Answer

Correct Answer: The element to render

Note: This Question is unanswered, help us to find answer for this one

20. What is the first argument, x, that is sent to the createElement function?React.createElement(x, y, z);

Answer

Correct Answer: The element that should be created

Note: This Question is unanswered, help us to find answer for this one

22. Which function is used to update state variables in a React class component?

Answer

Correct Answer: SetState

Note: This Question is unanswered, help us to find answer for this one

23. Per the following code, when is the Hello component displayed? const greeting = isLoggedIn ? : null;

Answer

Correct Answer: When isLoggedIn is true

Note: This Question is unanswered, help us to find answer for this one

24. Which choice will not cause a React component to rerender?

Answer

Correct Answer: One of the component's siblings rerenders

Note: This Question is unanswered, help us to find answer for this one

25. Which library does the fetch() function come from?

Answer

Correct Answer: No library. fetch() is supported by most browsers.

Note: This Question is unanswered, help us to find answer for this one

26. Which answer best describes a function component?

Answer

Correct Answer: A function component accepts a single props object and returns a React element.

Note: This Question is unanswered, help us to find answer for this one

27. Currently, handleClick is being called instead of passed as a reference. How do you fix this?

Answer

Correct Answer:

Note: This Question is unanswered, help us to find answer for this one

28. What can you use to wrap Component imports in order to load them lazily?

Answer

Correct Answer: React.lazy

Note: This Question is unanswered, help us to find answer for this one

29. Q42. Which Hook could be used to update the document's title?

Answer

Correct Answer: UseEffect(function updateTitle() { document.title = name + ' ' + lastname; });

Note: This Question is unanswered, help us to find answer for this one

30. How do you set a default value for an uncontrolled form field?

Answer

Correct Answer: Use the defaultValue property.

Note: This Question is unanswered, help us to find answer for this one

31. What package contains the render() function that renders a React element tree to the DOM?

Answer

Correct Answer: ReactDOM

Note: This Question is unanswered, help us to find answer for this one

32. Why is it a good idea to pass a function to setState instead of an object?

Answer

Correct Answer: SetState is asynchronous and might result in out of sync values.

Note: This Question is unanswered, help us to find answer for this one

33. What is sent to an Array.map() function?

Answer

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

Note: This Question is unanswered, help us to find answer for this one

34. All React components must act like _ with respect to their props.

Answer

Correct Answer: Pure functions

Note: This Question is unanswered, help us to find answer for this one

35. React components are composed to create a user interface. How are components composed?

Answer

Correct Answer: By nesting components

Note: This Question is unanswered, help us to find answer for this one

36. In which lifecycle method do you make requests for data in a class component?

Answer

Correct Answer: ComponentDidMount

Note: This Question is unanswered, help us to find answer for this one

37. What do you call a React component that catches JavaScript errors anywhere in the child component tree?

Answer

Correct Answer: Error boundaries

Note: This Question is unanswered, help us to find answer for this one

38. To create a constant in JavaScript, which keyword do you use?

Answer

Correct Answer: Const

Note: This Question is unanswered, help us to find answer for this one

39. A representation of a user interface that is kept in memory and is synced with the "real" DOM is called what?

Answer

Correct Answer: Virtual DOM

Note: This Question is unanswered, help us to find answer for this one

40. When using webpack, why would you need to use a loader?

Answer

Correct Answer: To preprocess files

Note: This Question is unanswered, help us to find answer for this one

41. Which of these terms commonly describe React applications?

Answer

Correct Answer: Declarative

Note: This Question is unanswered, help us to find answer for this one

42. Which attribute do you use to replace innerHTML in the browser DOM?

Answer

Correct Answer: DangerouslySetInnerHTML

Note: This Question is unanswered, help us to find answer for this one

43. What is the children prop?

Answer

Correct Answer: A property that lets you pass components as data to other components

Note: This Question is unanswered, help us to find answer for this one

44. Why is it important to avoid copying the values of props into a component's state where possible?

Answer

Correct Answer: Because you want to allow a component to update in response to changes in the props

Note: This Question is unanswered, help us to find answer for this one

45. When might you use React.PureComponent?

Answer

Correct Answer: When you want a default implementation of shouldComponentUpdate()

Note: This Question is unanswered, help us to find answer for this one

46. When do you use useLayoutEffect?

Answer

Correct Answer: When you need the browser to paint before the effect runs

Note: This Question is unanswered, help us to find answer for this one

47. What can you use to handle code splitting?

Answer

Correct Answer: React.lazy

Note: This Question is unanswered, help us to find answer for this one

48. Consider the following code from React Router. What do you call :id in the path prop?

Answer

Correct Answer: This is a route parameter

Note: This Question is unanswered, help us to find answer for this one

49. Which props from the props object is available to the component with the following syntax?

Answer

Correct Answer: All of them

Note: This Question is unanswered, help us to find answer for this one

50. Why might you use useReducer over useState in a React component?

Answer

Correct Answer: When you need to manage more complex state in an app

Note: This Question is unanswered, help us to find answer for this one

51. What is the name of the tool used to take JSX and turn it into createElement calls?

Answer

Correct Answer: Babel

Note: This Question is unanswered, help us to find answer for this one

52. How do you handle passing through the component tree without having to pass props down manually at every level?

Answer

Correct Answer: React Context

Note: This Question is unanswered, help us to find answer for this one

53. What is the testing library most often associated with React?

Answer

Correct Answer: Jest

Note: This Question is unanswered, help us to find answer for this one

54. If a function component should always render the same way given the same props, what is a simple performance optimization available for it?

Answer

Correct Answer: Wrap it in the React.memo higher-order component.

Note: This Question is unanswered, help us to find answer for this one

55. If you want to import just the Component from the React library, what syntax do you use?

Answer

Correct Answer: Import { Component } from 'react'

Note: This Question is unanswered, help us to find answer for this one

56. How can you bind a function to a component instance? (Check all that apply.)

Answer

Correct Answer: By Using .bind(this) in constructor.
By Declaring function as a class property.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

57. How you can provide an initial value for uncontrolled input?

Answer

Correct Answer: With "defaultValue" attribute.

Note: This Question is unanswered, help us to find answer for this one

58. _____ function is used for attaching event listeners on markup rendered by ReactDOMServer.

Answer

Correct Answer: ReactDOM.hydrate

Note: This Question is unanswered, help us to find answer for this one

59. Which of following is true about componentWillReceiveProps and getDerivedStateFromProps? (Check all that apply.)

Answer

Correct Answer: getDerivedStateFromProps is called before the first render while componentWillReceiveProps don't.
You must call this.setState in componentWillReceiveProps in order to update component state.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

60. What programming concept React use for DOM manipulation and updating?

Answer

Correct Answer: Virtual DOM

Note: This Question is unanswered, help us to find answer for this one

61. Can you return multiple elements from a single component?

Answer

Correct Answer: Yes, but you must use React Fragment.

Note: This Question is unanswered, help us to find answer for this one

62. How can you stop event propagation in React? (Check all that apply.)

Answer

Correct Answer: With stopPropagation function.
With preventDefault function.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

63. What happens when an error is not caught by error boundary?

Answer

Correct Answer: Whole React component tree gets unmounted.

Note: This Question is unanswered, help us to find answer for this one

64. What is the name of a pseudo-global variable that determines whether the environment is development or production?

Answer

Correct Answer: __DEV__

Note: This Question is unanswered, help us to find answer for this one

65. What is a recommended way of sharing data between multiple components? (Check all that apply.)

Answer

Correct Answer: Using Context.
Using flux architecture.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

66. ____ is flux architecture component that receives actions and broadcast payloads to registered callbacks.

Answer

Correct Answer: Dispatcher

Note: This Question is unanswered, help us to find answer for this one

67. How can type checking in React be done? (Check all that apply.)

Answer

Correct Answer: Using static type checkers like Flow and TypeScript.
Using PropTypes.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

68. Which function is invoked just before render() during component update?

Answer

Correct Answer: shouldcomponentUpdate()

Note: This Question is unanswered, help us to find answer for this one

69. Which of the following is true about keys in React?

Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

70. What is the difference between props and state?

Answer

Correct Answer: State is similar to props, but it is private and fully controlled by the component.

Note: This Question is unanswered, help us to find answer for this one

71. Which of the following is true about React Library?Which of the following is true about React Library? (choose all that apply)

Answer

Correct Answer: Updates DOM-tree
Reacts on events

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

72.

Can a single component render multiple nodes?

Answer

Correct Answer: Only if all children are wrapped with some node

Note: This Question is unanswered, help us to find answer for this one

73.

How can SyntheticEvent be stopped?

Answer

Correct Answer: Fire stopPropagation on event object
Fire preventDefaults on event object

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

74.

The defaultValue and defaultChecked props are only used during initial __?

Answer

Correct Answer: render

Note: This Question is unanswered, help us to find answer for this one

75.

What will be removed by JSX from the string inside node? 

Answer

Correct Answer: New lines in the middle of a string

Note: This Question is unanswered, help us to find answer for this one

76.

Which value will render nothing? (Check all that apply)

Answer

Correct Answer: null
false
undefined

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

77.

Is it possible to create ReactJS components without JSX? 

Answer

Correct Answer: Yes

Note: This Question is unanswered, help us to find answer for this one

78.

Which of the following is a correct JSX code? 

Answer

Correct Answer: <button onClick={activate}>Activate</button>

Note: This Question is unanswered, help us to find answer for this one

79.

Which of the following are valid properties of the input node in ReactJS? 

Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

80.

What is true about forceUpdate method in component? 

Answer

Correct Answer: It will re-render component skipping shouldComponentUpdate event

Note: This Question is unanswered, help us to find answer for this one

81.

What is true about context inside a component? 

Answer

Correct Answer: nextContext can be accessed at shouldComponentUpdate

Note: This Question is unanswered, help us to find answer for this one

82.

What is the correct value of the children proptype? propTypes: { children: React.PropTypes.string.isRequired } 

Answer

Correct Answer: 'test1'

Note: This Question is unanswered, help us to find answer for this one

83.

Which of the following is the correct data flow in a flux application? 

Answer

Correct Answer: Action->Dispatcher->Store->View

Note: This Question is unanswered, help us to find answer for this one

84.

What can be stored in the Stores while building with flux architecture? 

Answer

Correct Answer: Application state and logic

Note: This Question is unanswered, help us to find answer for this one

85.

Which statement is valid for ReactDOM.findDOMNode() function? 

Answer

Correct Answer: It returns the corresponding native browser DOM element

Note: This Question is unanswered, help us to find answer for this one

86.

What values can be passed as children of a ReactJs component? 

Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

87.

Which function is invoked just before render() during initial rendering? 

Answer

Correct Answer: componentWillMount()

Note: This Question is unanswered, help us to find answer for this one

88.

What would happen if the state is updated in componentWillMount? 

Answer

Correct Answer: State can't be updated in this method

Note: This Question is unanswered, help us to find answer for this one

89.

Which of the following will not allow an event to be accessed? 

Answer

Correct Answer: Asynchronous

Note: This Question is unanswered, help us to find answer for this one

90.

Which of the following properties are available for a wheel event? (Check all that apply)

Answer

Correct Answer: deltaMode
deltaX

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

91.

Which of the following are valid component life cycle events? (Check all that apply)

Answer

Correct Answer: componentWillUnmount
componentWillUpdate

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

92.

Which of the following is a valid Composition Event? 

Answer

Correct Answer: onCompositionUpdate

Note: This Question is unanswered, help us to find answer for this one

93.

Which of the following functions belong to ReactDOM? (Check all that apply)

Answer

Correct Answer: render()
findDOMNode()

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

94.

What are component methods? (choose all that apply)

Answer

Correct Answer: replaceState(newState)
setState(changes)
forceUpdate():

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

95.

In controlled components, which is the correct way to select multiple values using the select drop-down?

Answer

Correct Answer: <select defaultValue={["lahore", "london"]} multiple={true}> <option value="lahore">welcome lahore!</option> <option value="london">welcome london!</option> <option value="toronto">welcome toronto</option> </select>

Note: This Question is unanswered, help us to find answer for this one

96.

Which following method is used for updating the state of the component?

Answer

Correct Answer: setState()

Note: This Question is unanswered, help us to find answer for this one

97.

What are the Animation Events? (choose all that follow)

Answer

Correct Answer: onAnimationStart
onAnimationEnd
onAnimationIteration

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

98.

Which of the following code examples is correct for State object usage?

Answer

Correct Answer: this.setState(function(previousState, currentProps) { return {counter: previousState.counter + 1}; });

Note: This Question is unanswered, help us to find answer for this one

99.

What are the Component properties? (choose all that apply)

Answer

Correct Answer: this.isMounted
this.props
this.state

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

100.

The lifecycle methods can be grouped into the following categories?

Answer

Correct Answer: unmounting
updating
mounting

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

101.

What are the Composition Events? (choose all that apply)

Answer

Correct Answer: onCompositionUpdate
onCompositionStart
onCompositionEnd

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

102.

The state of the application is stored in the _____, from where the data then flows to the views?

Answer

Correct Answer: stores

Note: This Question is unanswered, help us to find answer for this one

103.

How can you set the state of a component, retrieve that state, create properties when initializing the component? I'm learning ReactJs! {this.props.name}

Answer

Correct Answer: var stateComp = React.createClass({ propTypes : { name : React.PropTypes.string }, getDefaultProps : function(){ return { name : "Mike" } }, getInitialState : function(){ return { value : 1 } }, render : function(){ return (

{this.state.value}
) } });

Note: This Question is unanswered, help us to find answer for this one

104.

In Redux a store has the following responsibilities? (choose all that apply)

Answer

Correct Answer: Makes possible to unregister listeners by calling the function returned
Registers new listeners with subscribe(listener)
Holding application state

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

105.

Lifecycle methods will receive context and SETSTATE() TRIGGERS AN UPDATE as follows? (choose all that apply)

Answer

Correct Answer: shouldComponentUpdate
componentWillReceiveProps

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

106.

Referencing context in lifecycle methods, the following lifecycle methods will receive an additional parameter in the context object? (check all that apply)

Answer

Correct Answer: componentWillReceiveProps(nextProps, nextContext)
shouldComponentUpdate(prevProps, prevState, prevContext)

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

107.

Which of the following code syntax is True in createClass?

class MyComponent extends React.Component { render () { return
; }
var MyComponent = React.createClass({ render: function () { return
; } });
var MyComponent = React.createClass( render () { return
; } }
class MyComponent extends React.Component ({ render: function () { return
; } });
Answer

Correct Answer: var MyComponent = React.createClass({ render: function () { return

; } });

Note: This Question is unanswered, help us to find answer for this one

108.

Which of the following are basic principles of Redux? (choose all that apply)

Answer

Correct Answer: Changes are made with pure function
State is read-only

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

109.

Which of the following types can be the ReactNode?

Answer

Correct Answer: Array of React Nodes, Plain Object, Array of Strings
ReactElement, String, number

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

110.

Which validator is used to check if property value is a number?

Answer

Correct Answer: React.PropTypes.number

Note: This Question is unanswered, help us to find answer for this one

111.

What is incorrect with the following component? class MyComponent extends React.Component { render() { return ( This is a component ); } }

Answer

Correct Answer: react render

Note: This Question is unanswered, help us to find answer for this one

112.

How many nodes should render() method return?

Answer

Correct Answer: 1

Note: This Question is unanswered, help us to find answer for this one

113.

Which of the following correctly explains the term "mounting"?

Answer

Correct Answer: A component is being inserted into the DOM.

Note: This Question is unanswered, help us to find answer for this one

114.

Do you need to add key property on ReactJs elements?

Answer

Correct Answer: Keys must be provided for list elements so ReactJs will know which element changed when state or props changes

Note: This Question is unanswered, help us to find answer for this one

115.

How to set ReactJS global configuration?

Answer

Correct Answer: ReactJs does not provide global configuration

Note: This Question is unanswered, help us to find answer for this one

116.

Which of the following is correct transformation of the following JSX syntax code?

Answer

Correct Answer: None of the above

Note: This Question is unanswered, help us to find answer for this one

117.

ReactJS is developed by _____?

Answer

Correct Answer: Facebook

Note: This Question is unanswered, help us to find answer for this one

118.

How write comments in JSX code?

Answer

Correct Answer: {/*your comment*/}

Note: This Question is unanswered, help us to find answer for this one

119.

Which of the following is/are not a valid component event?

Answer

Correct Answer: ondblclick
onblink

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

120.

Which is correct function to render ReactJs component at server side as static html page?

Answer

Correct Answer: ReactDOMServer.renderToStaticMarkup

Note: This Question is unanswered, help us to find answer for this one

121.

What visual design guidelines must be used to build web UIs with ReactJs?

Answer

Correct Answer: None

Note: This Question is unanswered, help us to find answer for this one

122.

Which of the following are mounting methods?

Answer

Correct Answer: componentWillMount, componentDidMount, render

Note: This Question is unanswered, help us to find answer for this one

123.

What does acronym JSX mean?

Answer

Correct Answer: JavaScript XML

Note: This Question is unanswered, help us to find answer for this one

124.

Can you use ReactJs with AngularJs on same web application?

Answer

Correct Answer: Yes

Note: This Question is unanswered, help us to find answer for this one

125.

Will and if yes, when and how immutable data will make big ReactJs application faster?

Answer

Correct Answer: For complicated data structure immutable data provides faster comparison

Note: This Question is unanswered, help us to find answer for this one

126.

What is default css display value for ReactJs web application?

Answer

Correct Answer: browser dependent

Note: This Question is unanswered, help us to find answer for this one

127.

Which statement about ReactJs is incorrect?

Answer

Correct Answer: ReactJs alone can be used to write native applications for Android and iOS

Note: This Question is unanswered, help us to find answer for this one

128.

How set custom html inside ReactJs component?

Answer

Correct Answer: div dangerouslySetInnerHTML={{__html: 'Some custom html'}} />

Note: This Question is unanswered, help us to find answer for this one

129.

Can you use ReactJs with NodeJS?

Answer

Correct Answer: Yes, you can render ReactJs application on NodeJs server and deliver it to browser

Note: This Question is unanswered, help us to find answer for this one

130.

Which of the following is the primary mental data flow in Flux?

Answer

Correct Answer: action -> dispatcher -> store -> view

Note: This Question is unanswered, help us to find answer for this one

131.

PropTypes is used for ___ ?

Answer

Correct Answer: typechecking

Note: This Question is unanswered, help us to find answer for this one

132.

Can you use ReactJs without flux?

Answer

Correct Answer: Yes

Note: This Question is unanswered, help us to find answer for this one

133.

Which JSX syntax is incorrect?

Answer

Correct Answer: Buttons.Fab />

Note: This Question is unanswered, help us to find answer for this one

134.

Which of the following is the correct way to create links for the react component?

Answer

Correct Answer: a href={'https://www.facebook.com/'}>Link1

Note: This Question is unanswered, help us to find answer for this one

135.

Which of the following are Flux Elements?

Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

136.

What is wrong with the following code? MyComponent.propTypes = { name: React.PropTypes.string } MyComponent.defaultProps = { name: 'My name' }

Answer

Correct Answer: default value is not necessary

Note: This Question is unanswered, help us to find answer for this one

137.

Which of the following attributes is used to set the default value of an input field?

Answer

Correct Answer: Both of the above

Note: This Question is unanswered, help us to find answer for this one

138.

ReactJS renders HTML tags if the element is defined in __

Answer

Correct Answer: Lowercase

Note: This Question is unanswered, help us to find answer for this one

139.

What does the following code do? componentDidMount () { this.context.router.replace('login')) }

Answer

Correct Answer: redirect router directory

Note: This Question is unanswered, help us to find answer for this one

140.

What does ReactJs provide?

Answer

Correct Answer: Sync between DOM and data

Note: This Question is unanswered, help us to find answer for this one

141.

Which of the following are correct React PropTypes? Check all that apply.

Answer

Correct Answer: symbol
node
array

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

142.

What will the following code do?

Answer

Correct Answer: LogoutContainer

Note: This Question is unanswered, help us to find answer for this one

143.

What kind of application architecture is widely used together with ReactJs?

Answer

Correct Answer: Flux

Note: This Question is unanswered, help us to find answer for this one

144.

What is needed to write ReactJs application with ES6 classes and have cross-browser support?

Answer

Correct Answer: Babel with react and es2015 presets

Note: This Question is unanswered, help us to find answer for this one

145.

What will happen if parent component will fire render function?

Answer

Correct Answer: Child components will fire shouldComponentUpdate

Note: This Question is unanswered, help us to find answer for this one

146.

Which of the following methods enables to set the initial state value, that is accessible inside the component via this.state?

Answer

Correct Answer: getInitialState

Note: This Question is unanswered, help us to find answer for this one

147.

Which function is invoked immediately before the initial rendering occurs?

Answer

Correct Answer: componentWillMount()

Note: This Question is unanswered, help us to find answer for this one

148.

Which of the following Lifecycle Methods does React include?

Answer

Correct Answer: ComponentWillMount
ShouldComponentUpdate

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

149.

What will happen to the state if you click the

constructor() { super(); this.state = { status: 'no status' }; } handleClick() { this.setState({status: 'I am fine!'}); } render() { return (
click me
); } }

Answer

Correct Answer: updates the status state to 'I am fine'

Note: This Question is unanswered, help us to find answer for this one

150.

Which of the following methods change the state of the component?

Answer

Correct Answer: Both of the above

Note: This Question is unanswered, help us to find answer for this one

151.

What is the first place to start optimizing speed of ReactJs application?

Answer

Correct Answer: Use component events to reduce render function calls

Note: This Question is unanswered, help us to find answer for this one

152.

To disable animations, you can add _____?

Answer

Correct Answer: transitionEnter={false}
transitionLeave={false}

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

153. Which of the following are the correct parameters used by the setState() function that is used for informing the React of a state change?

Answer

Correct Answer: data
ReactText

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

154. In relation to testing Reducers, which of the following functions are used by Jest for setting up tests?

Answer

Correct Answer: describe
It

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

155. In ReactJS, which of the following options is/are used for passing data to a render() function using the React API?

Answer

Correct Answer: this.props
this.state

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

156. Which of the following options are the child components of the React StreamTweet component?

Answer

Correct Answer: Header
Tweet

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

157. Which of the following Options can be a type of the React parameter, type?

Answer

Correct Answer: string
ReactClass

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

158. In relation to test if an entire website can be reached and used with the keyboard only. which of the following keys should be used for browsing?

Answer

Correct Answer: Tab
Shift+Tab

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

159. Which Of the following statements is correct about React f‌indDOMNode() method?

Answer

Correct Answer: This method is used for reading values out of the DOM.
It can only be used on the mounted components.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

160.

In relation to ReacUS, which of the following content should be added to the .eslintrc f‌ile which is created in the root of the project for enabling more accessibility rules?


Answer

Correct Answer:

{

"extends": ["react—app", "plugin:jsx—aily/recommended'].

"plugins": ["jsx—a11y"]

L



Note: This Question is unanswered, help us to find answer for this one

161. While setting ReactJS. which of the following commands is used for creating a root folder named reactApp and placing it on desktop?

Answer

Correct Answer: C:\Users\username\Desktop>mkdir reactApp

Note: This Question is unanswered, help us to find answer for this one

162. While setting up the ReactJS environment, which of the following options must be installed?

Answer

Correct Answer: Nodejs

Note: This Question is unanswered, help us to find answer for this one

163.

After installing Jest CLI. the below given script object of packagejson file are edited. It should be replaced with which of the following options?


Answer

Correct Answer:

"scripts":[

"test": "jest"

}



Note: This Question is unanswered, help us to find answer for this one

164.

In ReactJS, which of the following key syntaxes should be used if you do not have stable IDs for rendered items?


Answer

Correct Answer:

const exampleItems = examples.map((example, index) =>

  <li key={index}>

   {example.text}

  </li>

); 



Note: This Question is unanswered, help us to find answer for this one

165. What happens if the rendero is called again when the React element was previously rendered into container?

Answer

Correct Answer: It will perform an update on it and will only mutate the DOM as necessary for ref‌lecting the latest React element.

Note: This Question is unanswered, help us to find answer for this one

166.

Which of the following code snippets should be there in place of "???" in the below given program so that the following output is printed on the console?

Program

function ListItem(props) {

  return <li>{props.value}</li>;

}

function NList(props) {

  const numbers = props.numbers;

  return (

   <ul>

???

   </ul>

  );

}

const numbers = [8, 6, 4, 2, 1];

ReactDOM.render(

  <NList numbers={numbers} />,

  document.getElementById('root')

);

Output

•  8

•  6

•  4

•  2

•  1


Answer

Correct Answer:

{numbers.map((number) =>

    <ListItem key={number.toString()}

            value={number} />

  )} 


Note: This Question is unanswered, help us to find answer for this one

167.

Consider the given render method which is required to return the content enclosed inside parentheses.

render: function0{


return (


<div> Render me here </div>

);

}

In relation to the given information, which of the following statements is/ are true?

1. If JSX starts on the same line as the return. then parentheses are not needed.

2. Without the parentheses, JavaScript will ignore the given lines and return without a value.


Answer

Correct Answer:

Both statements 1 and 2


Note: This Question is unanswered, help us to find answer for this one

168.

Select True or False.

If the order of items may change in React then the use of indexes should be used for keys.


Answer

Correct Answer:

False 


Note: This Question is unanswered, help us to find answer for this one

169. Which of the following is a correct module provided by the Deque System. that is used for reporting the accessibility f‌indings directly to the console while developing and debugging?

Answer

Correct Answer: react-axe

Note: This Question is unanswered, help us to find answer for this one

170. In relation to testing Reducers, which of the following is the correct command for installing babel-jest package?

Answer

Correct Answer: npm install --save-dev babel-jest

Note: This Question is unanswered, help us to find answer for this one

171. In relation to ReactJS Flux, which of the following properties is used by JavaScript Objects Actions for informing about the data that should be sent to the store?

Answer

Correct Answer: type

Note: This Question is unanswered, help us to find answer for this one

172. In relation to React Test Renderer, which of the following options is NOT a TestRenderer instance?

Answer

Correct Answer: testInstance.type

Note: This Question is unanswered, help us to find answer for this one

173.

Which of the given render methods is correctly written?


Answer

Correct Answer:

render(){

return (<div>

[this.renderThis()]

[this.renderThat0]

</div>);

return [

<li key="List1">List1<lli>,

<li key="List2">List 2</li>,

<|i key="List3">List 3<l|i>.


];




Note: This Question is unanswered, help us to find answer for this one

174. From the given Options, choose the correct guideline(s) that should be followed while planning a React application.

Answer

Correct Answer: Multiple React components should be composed into a single React component.

Note: This Question is unanswered, help us to find answer for this one

175. Which of the following components is used by react for rendering multiple elements without a wrapper?

Answer

Correct Answer: React.Fragment

Note: This Question is unanswered, help us to find answer for this one

176. In relation to Flux programming concept. which of the following statements is correct about the data?

Answer

Correct Answer: The data flow is uni-directional.

Note: This Question is unanswered, help us to find answer for this one

177.

Which of the following commands are used for installing React and React DOM? (Consider reactApp as the root folder.)


Answer

Correct Answer:

C:\Users\username\Desktop\reactApp>npm install react --save

C:\Users\username\Desktop\reactApp>npm install react-dom --save 



Note: This Question is unanswered, help us to find answer for this one

178. Which of the following React methods is used for verifying that the children has a single child (a React element) only and returning it?

Answer

Correct Answer: React.Children.only(children)

Note: This Question is unanswered, help us to find answer for this one

179.

Which of the following options is the correct syntax for creating a new folder named Dispatcher in a project's ”/snapterest/ source/exampleDispatch directory?


Answer

Correct Answer:

var Dispatcher = require('f‌iux‘).Dispatchen

module.exports = new Dispatchero;   



Note: This Question is unanswered, help us to find answer for this one

180.

Which of the following is the correct syntax for creating a ReactElement of type h1 having the properties object and a ReactText as its only child?


Answer

Correct Answer:

[


render: function 0{


return React.createElement('h1'. [ className: ‘header' ], ‘React

Component‘);


I




Note: This Question is unanswered, help us to find answer for this one

181.

Which of the following is the correct syntax of React function that will enforce that names are written with all uppercase letters?


Answer

Correct Answer:

handleChange(event)[

this.setState({valuezeventtarget.value.toUpperCase0));



Note: This Question is unanswered, help us to find answer for this one

182. Which of the following options is the correct syntax for installing React CSS Transitions Group?

Answer

Correct Answer: npm install react-addons-css-transition-group

Note: This Question is unanswered, help us to find answer for this one

183. While testing Reducers, which of the following commands is used for installing Jest and the Jest CLI globally?

Answer

Correct Answer: sudo npm install —g jest

Note: This Question is unanswered, help us to find answer for this one

184. Which of the following Options is used by the StreamTweet component for incrementing the number of displayed tweets in the global object?

Answer

Correct Answer: componentDidUpdate()

Note: This Question is unanswered, help us to find answer for this one

185. Which of the following options is the correct Jest function that is used for each test?

Answer

Correct Answer: It

Note: This Question is unanswered, help us to find answer for this one

186.

While validating React component properties. a custom validator function is used for validating the tweet property. Which of the following parameters are passed to this function?

i) properties


ii) propertyName


iii) media


iv) componentName


Answer

Correct Answer:

Only options i), ii) and iv). 


Note: This Question is unanswered, help us to find answer for this one

187. Which of the following Lifecycle methods of ReactJS Component is/are used to clear up the memory Space?

Answer

Correct Answer: componentWillUpdate()

Note: This Question is unanswered, help us to find answer for this one

188. In relation to React Flux, which of the following arguments is/are passed to the connect function which is used to connect the root component to the store?

Answer

Correct Answer: Only select function

Note: This Question is unanswered, help us to find answer for this one

189. Which of the following packages is used for providing a React renderer that is used for rendering React components to pure JavaScript objects, without depending on the DOM or a native mobile environment?

Answer

Correct Answer: Test Renderer

Note: This Question is unanswered, help us to find answer for this one

190. A browser's native events are wrapped into which of the following objects by React for ensuring that all the supported events behave identically in Internet Explorer 8 and higher versions?

Answer

Correct Answer: SynthetiCEvent

Note: This Question is unanswered, help us to find answer for this one

191. Which of the following React components is responsible for displaying the collection controls and a list of tweets?

Answer

Correct Answer: Collection

Note: This Question is unanswered, help us to find answer for this one

192. Choose the correct type(s) of React component(s).

Answer

Correct Answer: Both options a and b.

Note: This Question is unanswered, help us to find answer for this one

193.

Choose True or False

In relation to React Flux, only the root component should be aware of a redux.


Answer

Correct Answer:

True 


Note: This Question is unanswered, help us to find answer for this one

194. In relation to React Forms. which of the following attributes is used by the