Q1 | What is the output of the following React code?
```javascript
import React from 'react';
... | |
---|
Q2 | What is the output of the following React code?
```javascript
import React from 'react';
... | |
---|
Q3 | What do you need to change about this code to get it to run?
```
import react from 'react';... | |
---|
Q4 | In the following React code snippet, what line is missing to properly render the component?
... | |
---|
Q5 | What value of button will allow you to pass the name of the person to be hugged?
```
impor... | |
---|
Q6 | How do you invoke the setStatus function only when the component mounts, using React hooks?
... | |
---|
Q7 | What is the name of this component?
```javascript
import React from 'react';
class MyCo... | |
---|
Q8 | What is the problem with the given code and how do you fix it?
```
const Component = () => ... | |
---|
Q9 | What does this React element look like given the following function?
```
React.createEleme... | |
---|
Q10 | What should the console display when the following code is run?
```
const [, , person] = ['... | |
---|
Q11 | Which Hook could be used to update the document's title? | |
---|
Q12 | What do you need to change about this code to get it to run?
```
class animal extends React... | |
---|
Q13 | When you log person to the console, what is the output?
```
const name = 'John';
const age... | |
---|
Q14 | What is the correct way to declare and initialize a state variable using the useState hook? | |
---|
Q15 | What is the correct way to render JSX in React? | |
---|
Q16 | How can you ensure that the useEffect hook runs only once after the initial render? | |
---|
Q17 | What is the recommended way to create a new React project using Create React App? | |
---|
Q18 | What type of element will be rendered from the following code?
```jsx
const element = (
... | |
---|
Q19 | What type of element will be rendered from the following code?
```jsx
const element = <h1>H... | |
---|
Q20 | How can you combine the following arrays using the spread operator?
```javascript
const arr... | |
---|
Q21 | What is the output of the following React code?
```jsx
import React from 'react';
export... | |
---|
Q22 | Find the bug in this React code:
```javascript
import React from 'react';
class App exte... | |
---|
Q23 | How do you fix the syntax error that results from running this React code?
```
import React f... | |
---|
Q24 | What happens when the following render() method executes?
```javascript
render() {
retur... | |
---|
Q25 | What happens when the following render() method executes?
```javascript
render() {
retur... | |
---|
Q26 | What should the console display when the following simple React code is run?
```javascript
... | |
---|
Q27 | What do you need to change about this code to get it to run?
```javascript
import React fro... | |
---|
Q28 | What should the console display when the following code is run?
```
const [, , animal] = ['Do... | |
---|
Q29 | What is the correct syntax to import only the `Component` from the React library? | |
---|
Q30 | Which Hook could be used to update the document's title? | |
---|