React State & Props Flashcards
1
Q
What is the difference between state and props in React?
A
State is a mutable data structure that holds local component data, while props are read-only and are passed down from parent to child components.
2
Q
How do you pass a function from a parent component to a child component?
A
Through props. e.g., <ChildComponent myFunction={this.myFunction} />.