reading-notes


Project maintained by mr-atta Hosted on GitHub Pages — Theme by mattgraham

State and Props

React: Component Lifecycle Events 🌱

## Based off the diagram, what happens first, the ‘render’ or the ‘componentDidMount’? the ‘render’ first.

## What is the very first thing to happen in the lifecycle of React? constractor.

## Put the following things in the order that they happen: componentDidMount, render, constructor, componentWillUnmount, React Updates ??

constructor ,React Updates , render , componentDidMount , componentWillUnmount .

## What does componentDidMount do?

This is where you run statements that requires that the component is already placed in the DOM.

♥️from

lifecycle


<hr>

Props 🆚 State

## What types of things can you pass in the props?

The values can be any data type, from strings to functions, objects, etc.

## What is the big difference between props and state?

## When do we re-render our application?

React components automatically re-render whenever there is a change in their state or props.

## What are some examples of things that we could store in state?

some data like you want to change or update in your application.

♥️from

♥️from

♥️from

Props vs State Props vs State

Props

State

#### React Bootstrap * React-Bootstrap replaces the code to react components,without unneeded dependencies and that givs us more countrol with the component.