Web Quiz
1. What is JSX?
A. A syntax extension for JavaScript
B. A syntax extension for React
C. A programming language
D. A CSS framework
Submit
2. How do you create a React component?
A. By using a JavaScript function
B. By using a CSS file
C. By using an HTML element
D. By using an XML file
Submit
3. What is a state in React?
A. A CSS style
B. A way to manage data in React
C. A storage space to store data
D. A method in JavaScript
Submit
4. What is the use of `componentDidMount`?
A. To update the DOM
B. To perform side effects after the component is mounted
C. To remove a component from the DOM
D. To initialize component state
Submit
5. What is the Virtual DOM?
A. A lightweight copy of the real DOM
B. The same as the real DOM
C. A JavaScript library
D. An event handling system
Submit
6. Which method in React is used to change the state?
A. changeState()
B. setState()
C. updateState()
D. modifyState()
Submit
7. What is React?
A. A back-end framework
B. A front-end library for building user interfaces
C. A programming language
D. A database
Submit
8. What is the purpose of `useState` in React?
A. To declare a state variable in functional components
B. To handle events
C. To render components
D. To manage component lifecycle
Submit
9. What is the difference between props and state?
A. Props are immutable, state is mutable
B. Props are used to pass data, state is used to manage data
C. Props are JavaScript objects, state is not
D. There is no difference
Submit
10. How do you pass data from parent to child component in React?
A. Using props
B. Using state
C. Using context
D. Using refs
Submit
Back To Home
Score