-
A framework is kind of like a boiler plate to build applications on.
-
A library is a bunch of reusable code that you can choose to access quickly to save time.
-
The difference between a framework and a library is that a framework calls your code and your code calls the library
Using frameworks allow you to spend less time on reinventing code and more time focusing on unique features.
-
Functional Components optionally take in properties, do not hold/manage state, and only output UI elements
const Greeting = () => <h1>Hi, I’m a functional component</h1>;
-
Class Components can contain logic, hold/manage state, usually hold numerous components (mostly functional)
class Greeting extends React.Component { render(){ return <h1>Hi, I’m a class component!</h1>; } }
Components are useful because they are independent and reuseable. They work like functions but work in isolation and return HTML elements
Props stand for properties which are used to pass data from one component to another. You can make the property optional by giving a f]deafult property value to the component. The props should be considered immutable.
State is keeping track of data values in between renders. The state gets its initial data from the constructor's super method. this data can be hard coded or be used from props. State will be changed when the component is rendered.