Try to answer the following questions to test your knowledge of this chapter:
- Does a component rerender when its props change?
- Does a component rerender when its parents props changes?
- How can we ensure a component rerenders only when its props change?
- What function prop would we use to add a keydown event listener?
- A component has the following props interface:
interface Props {
name: string;
active: boolean;
}
How can we destructure the props parameter and default active to true?
- Let's say we have a state called dateOfBirth. How can we type this so that it's a Date?
- How could we use the useEffect hook to call a synchronous function called getItems when a piece of state called category changes while passing category to getItems?