react-training-slides
[fit] Rangle.io
[fit] React Training
Prerequisites
Access to the command line
Node.js (v6 or higher)
NPM (v3 or higher)
Code editor (Sublime, Atom, etc.)
Some JavaScript knowledge (ES5/ES6)
Overview
ES6
Light functional JavaScript
From jQuery to React
Thinking in Components
create-react-app
Components
JSX
State & Props
Stateless components
Stateful components
Lifecycle methods
PropTypes
DOM mounting
REST API (fetch)
[fit] 🤷🏽♂️ Ecmascript 2015
[fit] Functional Programming
[fit] with JavaScript
Pure Functions
A function where the return value is only determined by
its input values
without observable side effects
Pure Functions (Slice vs. Splice)
Map, Filter & Reduce
Array helper methods map
, filter
and reduce
are examples of functional programming, which take in functions and do not mutate the original array.
Currying
A technique of converting a function that takes multiple arguments into a sequence of functions, each with a single argument.
Currying add
add
Currying add
add
Currying add
With ES6
add
With ES6[fit] React
Journey to React
Direct DOM manipulation/jQuery
Templates
Template based frameworks such as AngularJS
jQuery
Templates
AngularJS
First Gen. SPA Frameworks
Renders the DOM using templates
Manages DOM updates when data changes
Manages event bindings (
click
,scroll
, etc.)
[fit] How Is React Different?
[fit] views as pure
[fit] stateless functions
[fit] View(Data)
➡️ HTML
View(Data)
➡️ HTML
React
No templates
Define UI as components
connected to data
Re-renders the whole world when data changes
Manages event bindings
Hello, world!
[fit] JSX
JSX 🤷🏽♂️
JSX?
JSX
Virtual DOM
React Terminology
Virtual DOM ✅
JSX ✅
State
Props
Children
Stateless vs Stateful Components
Presentational vs Container Components
[fit] Components
Hello Component
Composition
Thinking in Components
Atomic Design Principles
We're not designing pages, we're designing systems of components -- – Stephen Hay
Atomic Design Principles
Atoms
Simplest building block
HTML tags
Easily styled
Highly reusable
Not very useful on their own
Molecules
Organisms
Ecosystem
What the client will see
Connected containers
Many components that make up a view
Environment
Root Component
Typically the
<App />
componentRepresents everything packaged together as an application
Component Hierarchy
Component Hierarchy
FilterableProductTable
SearchBar
ProductTable
ProductCategoryRow
ProductRow
Quiz
Breakdown the Mockup
Task
Breakdown the Mockup
Header
Navigator
NavigatorLink
Content
ProfileCard
ProfileImage
[fit] 🤖 Robodex
Let's Code!
Card
<RobotCard>
├ <Card>
├ <Media>
├ <Heading>
└ <SubHeading>
Last updated
Was this helpful?