Questions

Try to answer the following questions to test your knowledge of this chapter:

  1. Does a component rerender when its props change?
  2. Does a component rerender when its parents props changes?
  3. How can we ensure a component rerenders only when its props change?
  4. What function prop would we use to add a keydown event listener?
  5. 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?  

  1. Let's say we have a state called dateOfBirth. How can we type this so that it's a Date?
  2. 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?
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.147.91