reading-notes

Reading 02 State and Props

Why this is important?

React lifecycle

  1. Render happens first.

  2. A constructor for a component is the first thing that happens before the mounting phase begins.

  3. constructor, render, reactUpdates, componentDidMount, componentWillUnmount.

  4. componentDidMount is used for any action need after the component is rendered.

React State vs Props

  1. You can pass things that functions might need, similar to arguments. Ex: “Initial Count, Titles/Subtitles? source

  2. “Props you pass to a component while state is handled inside of a certain component. State updated inside component, props updated outside component. When you update state it will rerender the app.”

  3. You re-render the application once the user has performed an action and the state has changed.

  4. You can store dynamic values “Counter application”. Form inputs.

Things I want to learn