Хотите пройти тесты на Upwork на хороший результат?
Подавайте заявку и мы поможем Вам это сделать!

Do You want to pass tests on Upwork with good scores?
Leave the request and we will help You to do that!

ReactJS Test 2017

Share on RedditPin on PinterestEmail this to someoneShare on TumblrShare on LinkedInShare on Google+Tweet about this on TwitterShare on FacebookShare on VK

Мы не гарантируем правильность всех предоставленных ответов.


85 Test Questions:

1. Which of the following is true about Flux Dispatcher?

Answers:

• The dispatcher is used to broadcast payloads to registered callbacks.
• Dispatcher is used to checking changes in DOM.
• The dispatcher is used to set state in React application.
• The dispatcher is used to send data to components.

2. PropTypes is used for ___ ?

Answers:

• getInitialState
• Validation
• getPropsValue
• getDefaultProps
• typechecking

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

Answers:

• Flux
• Flux with MVC
• MVC
• Singleton
• Flex
• Rex pattern
• Fluxation architecture
• JSX architecture

4. Can you use ReactJs without flux?

Answers:

• Yes, but then you will have to use MVC
• Yes
• No
• No, it’s in core of ReactJS

5. Which statement about ReacJs is correct?

Answers:

• ReactJs uses MVC pattern to manipulate data flow inside application, that’s why it’s so easy to build native applications with it.
• With ReactJs you can write HTML in JS with JSX
• With ReactJs you extend HTML with custom ReactJs bindings
• ReactJs is closed source library produced by Facebook and used by many big companies in production: Airbnb, Facebook, Twitter and others
• ReactJs is fast because it has no virtual DOM and directly manipulates HTML document with MVC pattern
• ReactJs uses flux pattern instead of virtual DOM to manipulate singleton CSS objects

6. What should be the correct value of the children proptype?

propTypes: {
children: React.PropTypes.string.isRequired
}

Answers:

• 12
• [‘test’, ‘test2’]
• 99.66
• ‘test1’

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

Answers:

• action -> store -> dispatcher -> view
• store -> action -> dispatcher -> view
• store -> dispatcher -> action -> view
• action -> dispatcher -> store -> view
• dispatcher -> action -> store -> view

8. Why do you need dispatcher in flux?

Answers:

• To register store’s callbacks
• To create action creators
• It’s not needed in flux, you can just manipulate store directly
• Dispatcher is required by Redux
• To manipulate store directly without any additional actions

9. What is wrong with the following code?

MyComponent.propTypes = {
name: React.PropTypes.string
}
MyComponent.defaultProps = {
name: ‘My name’
}

Answers:

• defaultProps should be defaultProperties
• MyComponent.propTypes is a function not an object
• nothing is wrong
• default value is not necessary

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

Answers:

• Webpack or browserify to generate ES4 code
• Babel to transpile code to ES5
• Babel with es2015 plugin to transpile code to ES5
• Babel with CLI support
• Babel with react and es2015 presets

11. Which statement about propTypes is incorrect?

Answers:

• It improves auto completion for some IDEs
• It provides easier checking of production code
• It’s easy to define required props for each component
• If used with isRequired property, it automatically checks if property value is available while developing
• If used with isRequired property, it automatically checks if value is undefined while developing

12. Which is true for ReactJS components defined as pure JS functions?

Answers:

• Pure function component have only render method defined
• Pure function component do not have lifecycle methods or propTypes
• It’s possible to set defaultProps for pure function component
• Pure function component has everything what ES6 class has, but you can’t use inner state of the component, only way to mutate data is to fire new action and wait for props update

13. What will happen if parent component will fire render function?

Answers:

• Child components will fire render functions too to keep all UI state up to date
• Child components will fire shouldComponentUpdate
• Child components will fire shouldComponentUpdate only if store was updated during running render function of parent component
• Child components will fire shouldComponentUpdate only if state was updated during render of parent

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

Answers:

• You don’t need to optimize, Facebook already done it with virtual DOM
• Make better architecture of stores
• Use more inner state of components, stop firing too many actions
• Use component events to reduce render function calls
• Don’t use setState function
• Use props combined with inner component state

15. What does ReactJs provide?

Answers:

• Encapsulation for reusable components
• Sync between DOM and data
• Full framework with all tools to build modern web application
• Fast forms validation
• Objective-J for web
• It allows to write JS application with latest technologies like ES6 or even ES7

16. How transform JSX code in browser?

Answers:

• With Babel stand alone build
• Standard Babel and react preset
• JSXTransformer is recommended by Facebook starting from ReactJs v0.15
• You can’t use JSX in browser, must transpile it to ES5 before sending to browser

17. Do you need to add key property on ReactJs elements?

Answers:

• Keys must be provided for list elements so ReactJs will know which element changed when state or props changes
• Keys must be provided for list elements to work faster
• Keys should be provided for list elements
• Yes, keys must be provided for all elements

18. How set custom html inside ReactJs component?

Answers:

• <div dangerouslySetInnerHTML={{__html: ‘Some custom html’}} />
• <div dangerouslySetInnerHTML={‘Some custom html’} />
• <div innerHTML={‘Some custom html’} />
• <div innerHTML={{__html: ‘Some custom html’}} />
• <div innerHTML={{html: ‘Some custom html’}} />
• <customHtml>Some custom html</customHtml>
• <dangerouslySetInnerHTML>Some custom html</dangerouslySetInnerHTML>

19. Which of the following is true about React Library?
Note: There may be more than one right answer.

Answers:

• Make AJAX requests
• Update DOM-tree
• React on events
• Store data

20. What will happen to the state if you click the <div>

constructor() {
super();
this.state = {
status: ‘no status’
};
}
handleClick() {
this.setState({status: ‘I am fine!’});
}
render() {
return (
<div onClick={this.handleClick}>
click me
</div>
);
}
}

Answers:

• return false
• fatal error
• syntax error
• updates the status state to ‘I am fine’

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

Answers:

• Immutable data is one more abstraction layer and it will make application slower, but it will introduce better overall developer experience
• For complicated data structure immutable data provides faster comparison
• Immutable data won’t provide better performance because it requires more CPU cycles and RAM to create new objects on every change
• Immutable data use smart history cache when multiple mutations are done for same object, which provides easier shouldComponentUpdate implementation
• Immutable data will perform faster because it doesn’t create new pointers for every object, like normal objects do
• Immutable data will perform better because of abstracting prototype chain for all Object type data structures

22. Which statement about ReactJs is incorrect?

Answers:

• ReactJs alone can be used to write native applications for Android and iOS
• ReactJs can keep state out of the DOM while passing data through application
• ReactJs app can be rendered on the server
• ReactJs is used by Facebook.com in production
• You must know JavaScript to write ReactJs app
• ReactJs encourages writing html inside js file

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

Answers:

• componentDidMount()
• componentInit()
• componentWillUpdate()
• beforeRender()

24. ReactJS is developed by _____?

Answers:

• Google
• Facebook
• Apple
• Adobe

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

Answers:

• componentDidMount()
• componentBeforeOccur()
• componentWillReceiveMount()
• componentWillMount()

26. Which of the following are correct React PropTypes? Check all that apply.
Note: There may be more than one right answer.

Answers:

• symbol
• node
• boolean
• array
• function

27. What is default css display value for ReactJs web application?

Answers:

• inline
• flex
• block
• browser dependent
• none
• inherit
• inline-block

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

Answers:

• <a href={‘https://www.facebook.com/’}>Link1</a>
• <a link-to={testContainer}>Link1</a>
• <a href={[to-component]}>Link1</a>
• <a href-to={‘https://www.facebook.com/’}>Link1</a>

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

Answers:

• ondblclick
• onmousemove
• onclick
• onblink
• None of these. (All of these)

30. What is incorrect with the following component?

class MyComponent extends React.Component {
render() {
return (
This is a component
);
}
}

Answers:

• react render
• react component
• class should be replaced by className
• render should not be a function

31. Which of the following is true about keys in React?
Note: There may be more than one right answer.

Answers:

• React keys are useful when working with dynamically created components
• Setting the key value will keep components uniquely identified after the change
• React will use the key values to keep track of each element
• If key is present, is always supplied directly to the component as property.

32. How to set ReactJS global configuration?

Answers:

• React.setConfig
• ReactJs does not provide global configuration
• React.register
• React.configure

33. How can you create ReactJs component?

Answers:

• With ES6 Classes if using Babel, or with JS functions
• If initial state is needed only with ES6 classes extending React.Component, otherwise — with pure JS functions or React.createClass function
• JS functions, ES6 classes extending React.Component or React.createClass function, but then you can’t defined initial state
• JS functions, ES6 classes extending React.Component or React.createClass function
• JS functions, ES6 classes extending React.createClass or React.Component function
• With pure JS functions

34. How to set css class on div in ReactJs component?
Note: There may be more than one right answer.

Answers:

• <div className=»name» />
• <div class=»name» />
• <div class={‘name’} />
• <div cssClass={‘name’} />
• <div cssClass={‘name’} />
• <div ngClass={‘name’} />
• <div rClass={‘name’} />

35. To disable animations, you can add _____?
Note: There may be more than one right answer.

Answers:

• transitionEnter={false}
• transitionLeave={false}
• transitionLeave=false
• All of the above

36. Can you use ReactJs with AngularJs on same web application?

Answers:

• No, because both are using virtual DOM
• Yes
• No, because you can have only one view layer related library per project while using webpack, babel or browserify
• No, because ReactJs will re-render all html after initial load

37. Which event is best used to update state after props were changed?

Answers:

• shouldComponentUpdate
• componentReceivedProps
• componentWillReceiveProps
• componentUpdated
• componentWillUpdate
• shouldComponentUpdateState
• componentDidUpdate
• forceUpdate

38. How many nodes should render() method return?

Answers:

• 3
• 2
• 1
• 0

39. Can you use ReactJs with NodeJS?

Answers:

• No, because ReactJS is view layer in MVC and you can’t run views on server
• No, you can’t run ReactJs application on server side, it’s client side library.
• Yes, you can render ReactJs application on NodeJS server and deliver to browser, but only as static html
• Yes, you can render ReactJs application on NodeJs server and deliver it to browser

40. Which of the following are basic principles of Redux? (choose all that apply)
Note: There may be more than one right answer.

Answers:

• Changes are made with class
• Changes are made with pure function
• State is read-only
• Multiple data source path

41. In React.Component, the following method ____ fires immediately after the initial render?

Answers:

• componentWillMount() {
}
• componentDidMount() {
}
• componentDidUpdate() {
}
• componentWillUnmount() {
}

42. Which describes FLUX architecture?

Answers:

• single directional data flow
• dispatcher
• action creator
• store
• view layer

43. What are the Animation Events? (choose all that follow)
Note: There may be more than one right answer.

Answers:

• onAnimationStop
• onAnimationStart
• onAnimationEnd
• onAnimationIteration

44. What are the Component properties? (choose all that apply)
Note: There may be more than one right answer.

Answers:

• this.isMounted
• this.props
• this.state
• this.ref
• this.render

45. What does acronym JSX mean?

Answers:

• Jquery Syntax Extension
• JavaScript Syntax Extension
• Javascript Syntax Evaluation
• Javascript Specific Extension
• JavaScript XML

46. Which code snippet allows you to set value on a button click event?

Answers:

• class App extends React.Component{
constructor(){
super();
this.state ={data: ‘testing’};
}
buttonClick(){
this.setState({data: ‘Mjhos’});

this.setState = {data: [] }
}
render(){
return <div>
<button onClick={this. buttonClick.bind(this)}>Click Me!</button>
</div>
}
}
React.render(<App/>,document.getElementById(‘app’))

• class App extends React.Component{
constructor(){
super();
this.state ={data: ‘testing’};
}
buttonClick(){
this.setState{data: ‘Mjhos’};
}
render(){
return <div>
<button onClick={this. buttonClick.bind(this)}>Click Me!</button>
</div>
}
}
React.render(<App/>,document.getElementById(‘app’))

• class App extends React.Component{
constructor(){
super();
this.state ={data: ‘testing’};
}
buttonClick(){
this.setState(data: ‘Mjhos’);
}
render(){
return <div>
<button onClick={this. buttonClick.bind(this)}>Click Me!</button>
</div>
}
}
React.render(<App/>,document.getElementById(‘app’))

• class App extends React.Component{
constructor(){
super();
this.state ={data: ‘testing’};
}
buttonClick(){
this.setState({data: ‘Mjhos’});
}
render(){
return <div>
<button onClick={this. buttonClick.bind(this)}>Click Me!</button>
</div>
}
}
React.render(<App/>,document.getElementById(‘app’))

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

Answers:

• None
• Material design guidelines
• Flat design guidelines
• Facebook design guidelines
• Twitter design guidelines

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

Answers:

• ReactDOMServer.renderToString
• ReactDOM.render
• ReactDOMServer.renderToStaticMarkup
• React.render

49. Which of the following methods can be used to define any default props which can be accessed via this.props?

Answers:

• getDefaultProps
• componentWillMount
• componentDidMount
• render

50. How can you create React Component using the following code snippet?

Answers:

• var Component_Id = React.createClass{
render: function() {
return <div>React Component works!</div>;
}
};
React.render(
<div>
<Component_Id />
<Component_Id />
</div>
, document.getElementById(‘react-container’));

• var Component_Id = React.createClass({
render: function() {
return <div>React Component works!</div>;
}
});
React.render(
<div>
<Component_Id />
<Component_Id />
</div>
, document.getElementById(‘react-container’));

• var Component_Id = React.createClass(
render: function() {
return <div>React Component works!</div>;
}
);
React.render(
<div>
<Component_Id />
<Component_Id />
</div>
, document.getElementById(‘react-container’));

• var Component_Id = React.createClass extends component ({
render: function() {
return <div>React Component works!</div>;
}
});
React.render(
<div>
<Component_Id />
<Component_Id />
</div>
, document.getElementById(‘react-container’));

51. The following examples is an email input field. How do you represent the correct code? (choose all that apply)

React.createElement( «form»,null, React.createElement(«label»,
{ htmlFor: «email» }, «Email:»
), React.createElement(«input»,
{ type: «email», id: «email», className: «form-control-id» } )
);

Note: There may be more than one right answer.

Answers:

• <form>
<label htmlFor=»email»>Email:</label>
<input type=»email» id=»email» className=»form-control-id» />
</form>

• <form>
<label data=»email»>Email:</label>
<input type=»email» id=»email» element=>»form-control» />
</form>

• <form>
<label htmlFor=»email»>Email:</label>
<input type=»email» id=»email» className=»form-control-id» />
</form>

• <form>
<label for=»email»>Email:</label>
<input type=»email» id=»email» class=»form-control-id» />
</form>

52. 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}

Answers:

• var stateComp = React.createClass({
propTypes : {
name : React.PropTypes.string
},
getDefaultProps : function(){
return {
name : «Mike»
}
},
getInitialState : function(){
return {
value : 1
}
}
render : function(){
return (
<div>
{this.state.value}
</div>
)
}
});

• var stateComp = React.createClass({
propTypes : {
name : React.PropTypes.string
},
getDefaultProps : function(){
return {
name : «Mike»
}
},
getInitialState : function(){
return {
value : 1
}
},
render : function(){
return (
<div>
{this.state.value}
</div>
)
}
});

• var stateComp = React.createClass({
propTypes : function {
name : React.PropTypes.string
},
getDefaultProps : function(){
return {
name : «Mike»
}
},
getInitialState : function(){
return value : 1
}
},
render : function(){
return (
<div>
{this.state.value}
</div>
)
}
});

• var stateComp = React.createClass({
propTypes : function {
name : React.PropTypes.string
},
getDefaultProps : function(){
return {
name : «Mike»
}
},
getInitialState : function(){
return
value : 1
}
},
render : function(){
return (
<div>
{this.state.value}
</div>
)
}
});

53. Which of the following code syntax is True in createClass?

Answers:

• class MyComponent extends React.Component {
render () {
return <div />;
}

• var MyComponent = React.createClass({
render: function () {
return <div />;
}
});

• var MyComponent = React.createClass(
render () {
return <div />;
}
}

• class MyComponent extends React.Component ({
render: function () {
return <div />;
}
});

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

Answers:

• React.PropTypes.number
• React.PropTypes.integer
• React.DefaultPropTypes.number
• React.DefaultPropTypes.integer

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

Answers:

• dispatcher
• actions
• type
• stores

56. The lifecycle methods can be grouped into the following categories?
Note: There may be more than one right answer.

Answers:

• unmounting
• updating
• mounting
• initially
• All of the above

57. How do you display JSON data in table row?

var data = [
{product:»iPhone4″, price:300},
{product:»iPhone5″, price:400},
{product:»iPhone6″, price:600},
{product:»iPhone7″, price:750},
];

Answers:

• class App extends React.Component {
constructor(props){
super(props);
this.state={data: data}
}
render() {
return (
<div>
<div>{this.state.data( item => (
<tr>
<td>{item.product} =</td>
<td> ${item.price}</td>
</tr>
))}
</div>
</div>
);
}
};
ReactDOM.render(
<App />,
document.getElementById(‘box’)
);

• class App extends React.Component {
constructor(props){
super(props);
this.state={data: data}
}
render() {
return (
<div>
<div>{this.state.data.map( item => (
<tr>
<td>{item.product} =</td>
<td> ${item.price}</td>
</tr>
))}
</div>
</div>
);
}
};
ReactDOM.render(
<App />,
document.getElementById(‘box’)
);

• class App extends React.Component {
constructor(props){
super(props);
this.state={data: data}
}
render() {
return (
<div>
<div>{this.state.data.map( item = (
<tr>
<td>{item.product} =</td>
<td> ${item.price}</td>
</tr>
))}
</div>
</div>
);
}
};
ReactDOM.render(
<App />,
document.getElementById(‘box’)
);

• class App extends React.Component {
constructor(props){
super(props);
this.state={data: data}
}
render() {
return (
<div>
<div>{this.state.data( item = (
<tr>
<td>{item.product} =</td>
<td> ${item.price}</td>
</tr>
))}
</div>
</div>
);
}
};
ReactDOM.render(
<App />,
document.getElementById(‘box’)
);

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

Answers:

• this.setState(function(previousState, currentProps) {
return {counter: previousState.counter + 1};
});
• this.state = {( firstName: ‘Michael’, lastName: ‘Chan’ )}
• this.setState({someKey: ‘add new item’});
• this.setState = function(previousState, currentProps) {
return {counter: previousState.counter + 1};
});

59. Which of the following methods initiates custom state for the component?

Answers:

• getDefaultProps
• getInitialState
• getState
• getDefaultState

60. What will happen if this code is present in ReactJs component written as ES6 class:

shouldComponentUpdate(nextProps, nextState) {
return false;
}

Answers:

• Component will not render any visuals
• Component will not render any changes
• Throw error because shouldComponentUpdate must return true at least once per lifecycle of the component
• Display warning but will continue to work. This is useful for testing without actually rendering components.

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

Answers:

• <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>

• <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>

• <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>

• <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>

62. When use React.PureComponent?

Answers:

• Instead of calling shallow compare function while counting if component should update after props or state change
• While using ES5 and writing pure function component
• It’s globally available constant to check if component is pure, used to find unoptimized components
• It’s locally available constant to check if component is pure, used to find unoptimized components

63. Which of the following is correct transformation of the following JSX syntax code?
<Button type=»submit»>Save</Button>

Answers:

• React.createElement(
Button,
«submit»,
«Save»
);
• React.createElement(
Button,
«Save»,
{ type: «submit» }
);
• React.createElement(
Button,
[{ type: «submit» }],
«Save»
);
• React.createElement(
Button,
{ type: «submit», «text»: «Save» }
);
• None of the above

64. Which of the following types can be the ReactNode? (choose all that apply)
Note: There may be more than one right answer.

Answers:

• Array of React Nodes, Plain Object, Array of Strings
• ReactElement, String, number
• Array of React Nodes
• Array of Numbers, Array of Plain Objects, String

65. To store in Redux, a store is created by passing the reducer to a helper function called?

Answers:

• dispatch(action)
• subscribe(listener)
• reducer composition()
• None of the above

66. Lifecycle methods will receive context and SETSTATE() TRIGGERS AN UPDATE as follows? (choose all that apply)
Note: There may be more than one right answer.

Answers:

• shouldComponentUpdate
• componentWillMount
• componentWillReceiveProps
• componentWillUnmount

67. In Redux a store has the following responsibilities? (choose all that apply)
Note: There may be more than one right answer.

Answers:

• Makes possible to unregister listeners by calling the function returned
• Registers new listeners with subscribe(listener)
• Allow access to the action by exposing a setState() function
• Makes state mutations possible with state props
• Holding application state

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

Answers:

• getInitialState
• getState
• getDefaultProps
• getDefaultState

69. How SyntheticEvent can be stopped?

Answers:

• You can’t stop it, it will be fired for all parent components
• Return false from event handler
• Fire stopPropagation on event object
• Fire preventDefaults on event object

70. In React.Component which Method fires before rendering with new props or state?

Answers:

• shouldComponentUpdate() {
}
• componentWillUpdate() {
}
• componentDidUpdate() {
}
• componentWillUnmount() {
}

71. Which of the following method is called after getInitialState method?

Answers:

• componentWillMount
• componentDidMount
• getDefaultProps
• render

72. Which of the following Lifecycle Methods does React include?
Note: There may be more than one right answer.

Answers:

• ComponentWillMount
• ShouldComponentUpdate
• ComponentDidUnmount
• ComponentWillUpdate
• All of the above

73. What are the Composition Events? (choose all that apply)
Note: There may be more than one right answer.

Answers:

• onCompositionUpdate
• onCompositionStart
• onCompositionEnd
• onCompositionStop

74. How do you add a default property to a component?

Answers:

• var DefaultComp = React.createClass({
getDefaultProps : function(){
return {
name : «Mike»
}
}
render : function(){
return (
<h1>Hello {this.props.name}</h1>
)
}
});
• var DefaultComp = React.createClass({
getDefaultProps : function(){
return {
name = «Mike»
}
},
render : function(){
return (
<p>Hello {this.props.name}</p>
)
}
});
• var DefaultComp = React.createClass({
getDefaultProps : function(){
return {
name : «Mike»
}
},
render : function(){
return (
<p>Hello {this.props.name}</p>
)
}
});
• var DefaultComp = React.createClass({
getDefaultProps : function(){
return {
name => «Mike»
}
},
render : function(){
return (
<h1>Hello {this.props.name}</h1>
)
}
})

75. How write comments in JSX code?

Answers:

• // your comment
• <!— your comment —>
• {/*your comment*/}
• {// your comment}
• {<!— your comment —>}
• /*your comment*/

76. Which is the correct way to add styles for react elements?

Answers:

• <p style={{color: ‘red’}}>Paragraph</p>
• <p this.style={{color: ‘red’}}>Paragraph</p>
• <p this.bind.style(this)={{color: ‘red’}}>Paragraph</p>
• <p stylesheet={{color: ‘red’}}>Paragraph</p>

77. Which JSX syntax is incorrect?

Answers:

• <Buttons.Fab />
• <button></button>
• <myComponent><Button /><Button /><Button /></myComponent>
• <div style={{}}>hey</div>

78. Which of the following correctly explains the term «mounting»?

Answers:

• A component is being inserted into the Virtual DOM.
• A component is being removed from the DOM.
• A component is being re-rendered.
• A component is being inserted into the DOM.

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

Answers:

• setState()
• setStatus()
• Both of the above
• None of the above

80. Referencing context in lifecycle methods, the following lifecycle methods will receive an additional parameter in the context object? (check all that apply)
Note: There may be more than one right answer.

Answers:

• componentDidUpdate(nextProps, nextState, nextContext)
• componentWillReceiveProps(nextProps, nextContext)
• componentWillUpdate(nextProps, nextState, nextContext)
• shouldComponentUpdate(prevProps, prevState, prevContext)

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

Answers:

• componentDidMount()
• componentBeforeOccur()
• componentWillReceiveMount()
• componentWillMount()

82. This getDefaultProps() method maps default values for ____ that are missing when the React component is created?

Answers:

• state
• props
• class
• statics
• mixins

83. Which of the following are mounting methods?

Answers:

• componentWillUnmount, forceUpdate, componentDidMount
• getInitialState, shouldComponentUpdate, componentWillUpdate
• getInitialState, componentWillMount, componentDidMount
• forceUpdate, componentDidUpdate, componentDidMount
• componentWillMount, componentDidMount, render

84. Static object allows the defining of static methods and also means that these methods do not have access to or ?

Answers:

• render, props
• state, class
• class, component
• props, state

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

Answers:

• props
• render
• state
• constructor
• Component

  • Artyom T

    I have answered all the questions. You can get their if mail me to khaapt@mail.ru