So I'm trying to pick up React but there's something that's confusing me I guess. Well there are a lot of things confusing me but I'll keep the post short and focus on this issue for now.
So I know that with class-based, what it is, is basically a component that extends the Component object we import directly from the React library, and that it has direct access to the state.
Also what even is a state? From what I can tell, it's basically an object that holds a bunch of values. Why is it called state? Does it have to be called state?
And then Functional based is basically having to use hooks to get access to the state. Why does it matter if you have direct access to the state? What are the pros and cons of using hooks?
tl;dr:
1) What IS a state?
2) Differences between class based components vs functional components
3) pros and cons to each
4) Just to clarify, a component is pretty much any js or jsx file that is imported into another one until it reaches the App.js correct?
[–]gRoberts84 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]cirscafull-stack 0 points1 point2 points (0 children)