React is a js library(not a framework) to build interfaces. It is declarative, we can describe user interfaces by telling React what we want, not telling how to do it.
It is a simple function, receive input and returns output. The input can be props or state. It can be reusable and composable. Can manage private state
It reacts to user interaction. Updates to the browser.
Write HTML in JS - virtual DOM. Tree reconciliation(regarding to updating only specific pieces on that virtual DOM)
-
Function component is the simplest function with a simple contract.
-
Class component is a more featured way to render components. It can also receive props, but also handles a private internal state. Props are always fixed values but states can change.
Code moved to: https://github.com/mvoto/react-getting-started