|
Que No. 1 ) How do you create a functional component in React?
A.) By extending the React.Component class
B.) By defining a JavaScript function that returns JSX
C.) By using the "function" keyword inside a class
D.) By importing a pre-built component
|
Que No. 2 ) What is the purpose of the "props.children" property in React?
A.) It contains the component's internal state
B.) It represents the child components of a parent component
C.) It defines the component's styling
D.) It contains the component's methods
|
Que No. 3 ) What is a React fragment?
A.) A React component without a parent
B.) A lightweight representation of a DOM element
C.) A way to group multiple elements without adding an extra DOM node
D.) A component with no props
|
Que No. 4 ) How do you import a named export in React?
A.) Using the "import" statement with curly braces
B.) Using the "require" statement with parentheses
C.) Using the "import" statement without curly braces
D.) Using the "import" statement with square brackets
|
Que No. 5 ) What is the purpose of the "componentDidUpdate" lifecycle method in React?
A.) To fetch data from an API
B.) To perform cleanup operations before unmounting a component
C.) To update the component's state after it has rendered
D.) To initialize component state
|
Que No. 6 ) What is the primary role of Redux in a React application?
A.) To manage the presentation layer
B.) To handle server-side rendering
C.) To manage global state
D.) To control routing
|
Que No. 7 ) What is the purpose of the "shouldComponentUpdate" lifecycle method in React?
A.) To determine if a component should be re-rendered
B.) To force a component to re-render
C.) To initialize component state
D.) To perform side effects
|
Que No. 8 ) What does the "props" object contain in a React component?
A.) The component's internal state
B.) The component's methods
C.) Data passed from a parent component
D.) The component's CSS styles
|
Que No. 9 ) Which method is used to handle errors in React components?
A.) componentDidCatch()
B.) componentError()
C.) componentDidError()
D.) error()
|
Que No. 10 ) What is React's Context API used for?
A.) To create functional components
B.) To manage component state
C.) To handle form submissions
D.) To share data between components without props drilling
|