Intro to React
About me
Goal
Understand the basics of React, and learn how to define React components.
Roadmap
What is React?
A declarative, component-based JavaScript library for building user interfaces
Source: https://reactjs.org
Declarative
declarative programming is a programming paradigm — a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow.
How is React “declarative?” Declare how a component should look, and let React do the low-level job of calling the right DOM API methods to actually render it
Declarative vs. Imperative programming
React
developers
Understanding Components
Understanding Props
A component with props: Greeter.js
HelloWorld: using the Greeter component
→
Greeter.js, with JSX!
JSX
Want to see what JSX compiles to?
Note: you don’t have to use JSX to use React. If you don’t like it, don’t use it!
What is state?
A component with state: Counter
Props and State recap
Interactive Examples
Advanced topics
Thank you!
Questions?