Q1: What is React?
- A) A programming language
- B) A JavaScript library for building user interfaces
- C) A front-end framework for CSS
- D) A back-end framework for database management
Q2: What problems does React solve?
- A) Slow rendering of web pages
- B) Complex manipulation of the DOM
- C) Error-prone UI development
- D) All of the above
Q3: What is the virtual DOM in React?
- A) A concept for creating 3D user interfaces
- B) A representation of the real DOM in memory
- C) A technique for handling API calls in React
- D) A database used for storing component data
Q4: What are components in React?
- A) Independent modules of a React app
- B) Functions or classes that render UI and handle events
- C) Libraries for managing state in React
- D) CSS stylesheets for styling React components
Q5: What is the purpose of ReactDOM in React?
- A) Rendering React components to the browser
- B) Handling HTTP requests in React apps
- C) Managing state and props in React components
- D) Optimizing the performance of React apps
Q6: What are the benefits of using React?
- A) Easy to learn and use
- B) Fast and efficient rendering with the virtual DOM
- C) Modular and reusable component-based architecture
- D) All of the above
Q7: How can you create a React app using create-react-app?
- A) Run the command "create-react-app my-app" in the terminal
- B) Use an online React app builder tool
- C) Install React manually and set up the project from scratch
- D) None of the above
Q8: True or False: React uses a declarative approach to UI development.
- A) True
- B) False
Q9: True or False: React is primarily used for back-end development.
- A) True
- B) False
Q10: What will the following code render?
function App() {
return <h1>Hello, world!</h1>;
}
ReactDOM.render(<App />, document.getElementById("root"));
- A) A button that says "Hello, world!"
- B) A heading that says "Hello, world!"
- C) An input field with the label "Hello, world!"
- D) None of the above