Font size
WorksheetsGit, GitHub, and ReactJS Fundamentals
Total questions: 30
Worksheet time: 14mins
Which command initializes a new Git repository?
git start
git init
git new
git create
Which Git command is used to move changes from the working directory into the staging area, preparing them for commit?
git stage
git add
git commit
git push
What does git clone
Creates a new branch
Copies a remote repository to your local machine
Uploads files to GitHub
Deletes a repository
Which Git command shows the list of previous commits in a repository, including author, date, and message?
git history
git log
git commits
git view
What is the main purpose of GitHub?
Host and share code repositories online
Replace Git commands
Debug JavaScript code
Run CSS styling
What is a Pull Request in GitHub?
A request to create a new repository
A request to merge code changes into another branch
A request to delete a repository
A request to pull updates from Git
Which command downloads changes from a remote repository but does not merge them?
git merge
git fetch
git pull
git update
What does git push do?
Uploads local commits to a remote repository
Downloads commits from GitHub
Deletes a branch
Saves changes to the staging area
Good Git management includes:
Committing often with meaningful messages
Deleting all branches after use
Avoiding code reviews
Only pushing at the end of the project
In React, which function is used to create a state variable?
useState()
useEffect()
useContext()
setState()
Which React hook runs side effects like API calls?
useEffect()
useState()
useReducer()
useMemo()
In React, how do you import a component named Header?
import Header from './Header';
include Header from './Header';
require Header './Header';
fetch Header './Header';
How do you inject JavaScript expressions inside JSX (React HTML)?
{{ expression }}
%% expression %%
{ expression }
<< expression >>
Which statement about dynamic components is true?
They are hard-coded and cannot change.
They adapt based on props or state.
They cannot be reused.
They must always use CSS modules.
What is the default styling method in React?
Inline CSS
External CSS file imports
Using styled-components
Any of the above methods can be used
What does useEffect() with an empty dependency array [] do?
Runs only once after the initial render
Runs on every render
Runs only when state changes
Never runs
In React, what does .map() typically help with?
Iterating arrays to display lists of elements
Adding CSS styles
Managing global state
Handling API requests
Which is NOT a best practice in Git commit messages?
Writing clear and concise descriptions
Using present tense
Pushing all commits without reviewing
Grouping related changes in one commit
In React, props are:
Variables used only for CSS styling
Read-only data passed from parent to child components
Functions that update state
Hooks that manage lifecycle
Which CSS rule is correct in a React component with inline style?
style={{background-color: 'blue'}}
style={{backgroundColor: 'blue'}}
style="background-color: blue"
style=(backgroundColor: blue)
List three Git commands used for managing branches.
Enumerate the three main steps in the basic Git workflow (before pushing to remote).
Name at least three benefits of using GitHub in team projects.
Enumerate the stages of a Pull Request process.
List three good practices for Git commit messages.
Enumerate at least two React hooks.
List two ways to style components in React.
Enumerate the steps to import and render a component in React.
List three use cases for useEffect().
Enumerate at least three advantages of using dynamic components in React.
