Class 2

Ryan Pearson
1 min readNov 4, 2021
  • Discuss in words something you learned in class today or this week.

This week in class we learned about the very basics of React, specifically the difference between class based and functional based components

  • Why/when would you use a class-based component vs a functional component? What are the differences? What new alternatives are there?

In the past you would need to use a class based component when you wanted to manipulate state, but now you can do that with functional based components as well and that is the go-to way to use React.

  • What is create-react-app? Dig into this.

create-react-app is the startout boilerplate code for react. You can initalize your project with it and everything you need to code in React has been added in

  • What is JSX?

This creates html elements in javascript code

  • How does React work? From entry point to last child component? How?

React allows you to write html and css in your javascript file making it easier and more efficient

  • How does the virtual DOM work in React? Explain in detail.

Its a copy of the site used by React to tell if something has been changed

  • What’s the difference between a React Element and a React Component?

Components are either functional or class based and help pass along data, elements help display the data that has been manipulated

--

--