The Frontend (with React.js)
Question #80
A) setState
B) prop
C) key
D) state
Question #81
A) Yes
B) No
C) Only function components can be used without JSX
D) Only class components can be used without JSX
Question #82
A) Only for the top-level component
B) When we need to manage state or use lifecycle methods
C) Only for components that are children of class components
D) Only for a component that is the parent of a class component
Question #83
A) Using the map
array method
B) Using the <Each />
component
C) With a for
/while
loop
D) Using the reduce
array method
Question #84
A) Place the state in a third component C that is a sibling to A and B
B) Place the state in either A or B
C) Restructure the application to have A and B be related differently
D) Place the state in the parent component of A and B
Question #85
A)
onClick={doSomething()}
B)
onClick={() => doSomething}
C)
onClick={doSomething}
D)
onClick="doSomething()"
Question #86
A) Parsing data that is included with initial markup is more efficient than parsing data from ajax requests
B) React uses the data in its markup comparing algorithm to be able to hydrate the application
C) It makes the initial request more efficient over the network
D) Redux requires an initial state object
Question #87
A) Using this.setState({message: newMessage})
in the Message component
B) Using props.message = newMessage
in the Message component
C) Using this.setProp({message: newMessage})
in the Message component
D) The parent component can pass a new value for message
Question #88
A) <User prop.firstName="Max" />
B) User.firstName('Max');
C) User.setFirstName('Max');
D) <User firstName="Max" />
Question #89
A) React.createInstance
B) React.createElement
C) React.renderElement
D) React.renderComponent
Question #90
A) constructor()
B) componentDidMount()
C) shouldComponentUpdate()
D) componentDidUpdate()
Question #91
A) Create a class with a static render()
method
B) Instantiate a new object from React.Component
C) Create a class that extends React.Component
and defines a render()
method
D) Create a function that returns a React element and then define the component state as a property on that function
Question #92
A) A function that takes an existing component and returns another component which wraps the first component
B) A component with a higher number of children elements
C) A component that gets rendered before another component
D) A component with a level higher up in the DOM tree
Question #93
A) AudioPlayer
B) audioPlayer
C) audioplayer
D) audio_player
Question #94
A) It’s another name for function components
B) A component that will not render on updated props/state if the new values match the old ones
C) A component that cannot have private state
D) A component that will purely represent a UI element
Question #95
A) An object with lowercase properties.
B) An object with camelCased properties
C) A string of valid CSS attributes
D) An object with snake_case properties
Question #96
A) React.ref()
B) new React.ref()
C) ReactDOM.findDOMNode()
D) React.createRef()
Question #97
A) The event parameter in React is pooled. You cannot access it in an asynchronous way
B) You can’t use the "this" keyword in a handler without binding the function first
C) The use of inline functions as event handlers is not allowed in React
D) The onClick event is only valid on clickable element like anchors
Question #98
A)
let counter = this.state.counter; this.setState({ counter: counter + 1 });
B)
this.setState({counter}, $inc);
C)
this.setState(state => ({counter: state.counter + 1});
D)
this.setState({ counter: ++this.state.counter });
Question #99
A)
render() { return ( <div></div><div></div> ); }
B)
render() { return ( <> <div></div><div></div> </> ); }
C)
render() { return ( <React.Fragment> <div></div><div></div> </React.Fragment> ); }
D)
render() { return "hello"; }
Question #100
A) componentWillUnmount
B) componentDidThrow
C) componentDidCatch
D) componentDidUnmount