Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What are props in React?
A. Mutable data that can be changed by the child
B. Read-only data passed from a parent to a child
C. Internal data managed by a component
D. Global state
Direction: Choose the correct option

Q2.

How do you pass a prop named 'name' with value 'John' to a component?
A. <MyComponent name="John" />
B. <MyComponent name=John />
C. <MyComponent {name: 'John'} />
D. <MyComponent name='John' />
Direction: Choose the correct option

Q3.

Can a child component modify its props?
A. No, props are immutable
B. Yes, by reassigning
C. Only if the parent allows
D. Yes, using this.props.modify()
Direction: Choose the correct option

Q4.

What is the purpose of defaultProps?
A. To define the prop types
B. To make props required
C. To initialize state
D. To set default values for props if not provided
Direction: Choose the correct option

Q5.

Given , how does the Child component receive the prop?
A. As an argument to the function (functional) or this.props (class)
B. Through a context
C. It cannot receive
D. Via a global variable