wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

React and GitHub Quiz

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

What is the purpose of a React component?

a)

To manage the database

b)

To style the application

c)

To define routes

d)

To build reusable UI blocks

2.

How do you pass data from a parent component to a child in React?

a)

Using state

b)

Using CSS

c)

Using context

d)

Using props

3.

Which keyword is used to create a functional component in React?

a)

component

b)

const

c)

new

d)

function

4.

What does the following expression do in React: {isLoggedIn ? "Welcome" : "Please Log In"}?

a)

It throws an error

b)

It creates a loop

c)

It conditionally renders text

d)

It checks types

5.

Why do we need to use a key when rendering a list with .map() in React?

a)

To style each element

b)

To help React efficiently update and reorder items

c)

To prevent errors

d)

To identify the parent component

6.

What is the correct way to iterate over an array of items and render components in React?

a)

array.foreach()

b)

array.map()

c)

array.filter()

d)

array.map() inside JSX

7.

What is the result of this code? {isVisible ? Hello : Goodbye }

a)

It shows one paragraph based on isVisible

b)

It shows both elements

c)

It shows nothing

d)

It breaks the app

8.

What is a prop in React?

a)

A local variable

b)

A lifecycle method

c)

A CSS class

d)

A way to pass data to components

9.

How should you write a list rendering with keys in React?

a)

item

b)

{key=item}

c)

item

d)

item

10.

What does this code do? <MyComponent name="Alex" />

a)

Passes "Alex" as a prop to MyComponent

b)

Calls a function

c)

Declares a class

d)

Passes a value through a hook

11.

What is the purpose of GitHub Desktop?

a)

Hosting websites

b)

A GUI for Git version control

c)

Writing code in the cloud

d)

Managing npm packages

12.

What does "committing" mean in GitHub Desktop?

a)

Erasing all code

b)

Merging branches

c)

Downloading a project

d)

Saving a snapshot of your changes