Search Header Logo

SEB-72 Week 7 Beginnings of React

Authored by Lay Jones

Instructional Technology

Professional Development

Used 3+ times

SEB-72 Week 7 Beginnings of React
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the new way to create a new React Project?

npx create vite

npm create-react-app MyApp

npm create vite

npx create-react-app my-app

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What command is used to start the React local server (using the new way of creating a react app)

npm run dev

npm run start

npm run build

node server

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

I get a ' Adjacent JSX elements must be wrapped in an enclosing tag' error with this code, why might that be?:

return (

<div> div 1 </div>

<div> div 2 </div>

);

You need to add a semicolon at the end of each
element

Each div requires a unique id or class

React can only return one parent jsx/html element, you need to put these divs inside of something else.

The return must be {} instead of ()

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

In React, how can we pass the data from one component to another?

By using jQuery
By directly modifying the state of the other component
By passing data through URL parameters

Props

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the purpose of the useState hook in React?

The purpose of the useState hook in React is to add state to functional components.
To create new components in React
To add styling to functional components

To render elements on the page

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the correct syntax for useState?

const [setValue, value] = useState('initialValue');

const { value, setValue } = useState('initialValue');

const { setValue, value } = useState('initialValue');

const [value, setValue] = useState('initialValue');

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which is not an in-built hook in react

useRef()

useEffect()

useState()

useFetch()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?