React Topics

  1. How would you describe the concept of "state"?

In React State refers to values that a component can maintain between render cycles.

A way for React to remember saved values from within a component. This is similar to declaring variables from within a component, with a few added bonuses (which we'll get to later)

  1. When would you want to use props instead of state? Anytime you want to pass data into a component so that component can determine what will get displayed on the screen.

  2. When would you want to use state instead of props? Anytime you want a component to maintain some values from within the component. (And "remember" those values even when React re-renders the component).