Font size
WorksheetsREACT-JS
Total questions: 15
Worksheet time: 8mins
What is React in the context of web development?
CSS Framework
JavaScript Library
JavaScript Framework
Frontend Tool
What is the main goal of React?
Developing User Interfaces
Creating Mobile Applications
Managing Databases
Building Backend Services
Arjun is setting up a React environment and is confused about which tool to use. Which tool can be used to set up a React environment?
Angular CLI
Vite
Vue CLI
Webpack
What is the first step to start a new project using Vite?
Run The Development Server Using npm run dev.
Install The Dependencies
Choose The Template
Open Your Terminal & Run the following command – npm create vite@latest
What is the main advantage of using React in a web development project?
Efficient DOM manipulation
Server-side rendering
Database management
Backend development
Which feature of React allows for code reusability in a project?
Components
State management
Routing
Styling
What is the virtual DOM in React?
A lightweight version of the actual DOM
A separate database for storing DOM elements
A tool for debugging React components
A feature for server-side rendering
What is the purpose of JSX in React?
To write HTML elements in JavaScript
To style React components
To manage state in React
To create server-side scripts
Explain the concept of state in React components.
State is used for storing data that can change over time
State is used for defining the structure of components
State is used for handling routing in React applications
State is used for server-side rendering of components
How to style react components?
CSS Modules
Component Libraries
Styled Components
None of these
What is the significance of props in React components?
Props are used for passing data from parent to child components
Props are used for styling components
Props are used for managing state in components
Props are used for server-side rendering
What is the purpose of using keys in React lists?
To uniquely identify list items and improve performance
To apply different styles to list items
To manage state within list components
To create nested lists efficiently
What is the main difference between state and props in React?
State is mutable and controlled by the component itself, while props are immutable and passed down from parent components
State is immutable and passed down from parent components, while props are mutable and controlled by the component itself
State is used for styling components, while props are used for managing state
State is used for server-side rendering, while props are used for client-side rendering
Explain the concept of props drilling in React.
Passing props from parent to child components multiple levels deep
Passing props from child to parent components
Passing props between sibling components
Passing props to stateful components
Guess The Output: What is value of y?
let y = [1, 2, 3].map(x => x ** 2);
[1, 4, 9]
[2, 4, 6]
[1, 2, 3]
[undefined, undefined, undefined]
