React Lifecycle
Non-Visual Behavior
Testing
100

What are the three lifecycle stages of the react lifecycle?

componentDidMount, componentDidUpdate, and componentWillUnmount

100

What is stateful logic?

It can be a function that handles a click event or maybe a function that sets toggle state, or even a function that formats data before it gets displayed. Usually, this logic deals with state in the component.

100

What is integration testing?

In integration testing, several units of software are tested as a group to ensure they work together correctly. 
200

Which phase of the lifecycle is this: When the component is being build out from the ground up. 

componentDidMount 

200

How is non-visual behavior (stateful logic) applied usually?

Custom Hooks

200

What is end to end testing?

End-to-end testing is where the whole application is tested, simulating real user scenarios closely.

300

What happens in the growth/updating phase of the lifecycle?

In the componentDidUpdate phase, setState is set to update component data.

300

What is a custom hook?

Custom Hooks, are so-called because you are building the hook yourself (customizing it), to apply non-visual behavior and stateful logic throughout your components. This way, you can reuse the same hook over and over again.

300

What is Unit Testing?

When we test smaller units of software (often functions or methods) in isolation.

400

Which phase is considered the death of the lifecycle?

componentWillUnmount

400

True or False: Can a custom hook be used in place of useState? Example:

const CustomForm = () => {
  const [username, setUsername, handleUsername] = useInput("");

}

True

400

We use _______ - _______ - library to run tests in this unit. Unlike previous testing libraries, this is designed with the user in mind, testing components via DOM nodes.

react-testing-library

500

What is missing in this class component?
class MyComponent extends React.Component {
  constructor() {
   ________
    this.state = {
       arbitraryStateData: data,
    }
  }
}

super()

500

Freebie: What were the two custom hooks you used in your project this week?

useLocalStorage and useDarkMode

500

The ______ method renders a React element into a virtual DOM and returns utility functions for testing the component.

Hint: It's mentioned somewhere in this statement.

render