Summarize the five steps of thinking in react.
What is one reason a local variable isn’t sufficient for managing a React component?
What is the argument to the useState hook, and what are the two parts of its return array?
How can Component A access state from Component B?
- Component A can access state from Component B by passing the state from Component B to Component A as a prop. Component A can then access the state from Component B by accessing the prop. If Component B needs to update the state, it can pass a function to Component A as a prop. Component A can then call the function with the new state value, which will cause Component B to re-render with the new state value. If Component B needs to update the state based on the current state value, it can pass a function to Component A as a prop. Component A can then call the function with a function that takes the current state as an argument and returns a new state value. This is useful when the new state value depends on the current state value.
What are your learning goals after reading and reviewing the class README?