React.js Basics

Quiz yourself on components,props,and state management in React.

1. What is React.js primarily used for?
2. Which syntax is used to embed HTML within JavaScript in React?
3. What is the smallest building block of a React application?
4. Which function is used to render a React component to the DOM?
5. What are functional components in React?
6. Which mechanism is used to pass data from a parent to a child component?
7. What does the useState hook return?
8. Which lifecycle method runs after a component is inserted into the DOM?
9. What is the purpose of the 'key' prop in React lists?
10. Which of the following is NOT a valid React component type?
11. Which of the following are built-in React hooks? (Select all that apply)
12. Which statements about JSX are true? (Select all that apply)
13. Which events can trigger a React component to re-render? (Select all that apply)
14. React is a JavaScript framework, not a library.
15. State in React can be directly modified (e.g., this.state.count = 5).
16. JSX supports if-else statements directly within the markup.
17. The useEffect hook can replace lifecycle methods like componentDidMount in functional components.
18. What does JSX stand for?
19. Name the hook used to access context values in functional components.
20. What method is used to update state in class components?
Answered 0 of 0 — 0 correct