# Module Quiz: Project Functionality

1. **You are implementing a stateful component in your React project which will display the number of people living in your town. Which of the following React hooks should be used to update the state of the component?**
    
    * setEffect()
        
    * useEffect()
        
    * setState()
        
    * <mark>useState()</mark>
        
2. **What is the benefit of** `useState` **over** `useReducer`**?**
    
    * There is no benefit.
        
    * `useReducer` is more performant.
        
    * `useState` <mark> is more performant.</mark>
        
3. **What is the type of data which is passed from a parent component to a child component?**
    
    * `props` <mark> data</mark>
        
    * state data
        
    * mutable data
        
    * variable data
        
4. **True or False: Uncontrolled components are components that do not maintain their own state.**
    
    * <mark>True</mark>
        
    * False
        
5. **Which React hook must be utilized when calling an API using the** `fetch()` **method?**
    
    * <mark>useEffect</mark>
        
    * useState
        
    * useReducer
        
6. **Which data transfer format is most commonly used with APIs?**
    
    * Text
        
    * XML
        
    * <mark>JSON</mark>
        
7. **Which one of the following code snippets is a valid unit test?**
    
    * ```javascript
        unitTest("Validate title", () => {
          render(<App />); 
        
          const actualTitle = screen.getByTestId("pageTitle"); 
          const expectedTitle = "My Web Page";
        
         expect(actualTitle).toBe(expectedTitle);
        });
        ```
        
    * ```javascript
        test("Validate title", () => {
          render(<App />); 
        
          const actualTitle = screen.getByTestId("pageTitle"); 
          const expectedTitle = "My Web Page";
        
          expect(actualTitle).toBe(expectedTitle);
        });
        ```
        
    * ```javascript
        function("Validate title", () => {
          render(<App />); 
        
          const actualTitle = screen.getByTestId("pageTitle"); 
          const expectedTitle = "My Web Page";
        
          expect(actualTitle).toBe(expectedTitle);
        });
        ```
        
8. **What is this code in JavaScript:**
    
    `/Make Your Reservation/`**?**
    
    * <mark>RegExp object literal</mark>
        
    * A string literal
        
    * An array literal
        
9. **How many major elements are outlined by the WCAG (Web Content Accessibility Guidelines) for designing accessible websites?**
    
    * three
        
    * six
        
    * <mark>four</mark>
        
    * five
        
10. **True or False: You can use arrow functions to update the state of a component.**
    
    * <mark>True</mark>
        
    * False
        
    * Only in some cases.
        
    * Only in certain types of state.
        

---

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728120011870/14fb21e3-9067-4fe1-80c3-3ea7c4b1caff.png align="center")
