SlideShare a Scribd company logo
REACT FUNDAMENTALS
JAKARTA JS
Simon Sturmer
: @sstur_
CTO / Fouder - KodeFox
WHY REACT?
Part One
WHAT IS REACT?
▸ So you've heard the hype, but what is React?
▸ React is an opinionated View library.
▸ It is a fundamentally different way to build UIs.
▸ It leads to thinking in terms of pure functions and
immutability and other good practices.
WHY REACT?
▸ Why are so many top companies choosing React?
▸ Netflix, Yahoo, Apple, AirBnB, WhatsApp, CloudFlare,
Dropbox, Instagram, Twitter, Uber, WordPress even
SaleStock Indonesia
▸ Performance, Testability, Code Reuse
▸ Developer Experience.
WHY REACT?
▸ How is React different from Angular/Ember/etc?
▸ Everything is a component.
▸ A component is a pure function of application state.
▸ Components can be reused, composed to create other
components, isolated for testing.
▸ UI is easy to reason about as state changes over time.
REACT IS A BUSINESS
DECISION, NOT JUST A
TECHNOLOGY CHOICE!
REACT AS A BUSINESS DECISION
▸ Fewer, more versatile software engineers!
▸ Same dev team! Web, iOS, Android, Desktop
▸ Improved Testability, Reliability
▸ Performant by Default
▸ Real Code Reuse
▸ Velocity: shorten the edit-reload cycle; less time debugging
▸ Future proof: As your software evolves, replace individual
components.
WHY BUSINESSES STILL CHOOSE ANGULAR/EMBER?
▸ New tech can be overwhelming. Where to start?
▸ How to train your dev team?
▸ Some have large, legacy code-bases with a lot of
resources invested.
HOW IS REACT
DIFFERENT?
Part Two
WHAT PROBLEM DOES REACT TRY TO SOLVE?
▸ App state changing over time is hard to reason about.
▸ UI components get out of sync with each other and it's
hard to debug.
▸ When changes happen, we have to reach deep into our
view and mutate objects.
SHARED MUTABLE STATE IS
THE ROOT OF ALL EVIL
Pete Hunt, React.js Conf 2015
REACT + REDUX GIVES YOU IMMUTABLE STATE
REMEMBER THE OLD DAYS?
▸ Server-side Rendering
▸ Generating HTML views was easy!
▸ Why? … because we had the full application state at
one moment in time (a snapshot)
▸ All we have to do is query stuff and generate HTML
from that stuff.
▸ When an action happens, re-generate the entire view!
SERVER-SIDE RENDERING
SPRINKLING JS ON TOP
▸ Web apps slowly started doing more client-side
▸ DOM Manipulation: jQuery
▸ Client-side templating: mustache, handlebars
▸ Must wire-up events every time you generate new DOM
▸ Still need to manipulate the DOM!
EVENTS UPDATING VIEW
THE PROBLEM:
▸ There's way too much complexity around keeping your
app in a consistent state.
▸ It's almost impossible to reason about.
▸ The bookkeeping makes for a poor developer experience.
THE SOLUTION:
▸ We never had that problem with server-side rendering!
▸ … because we just re-generated the entire view when a
piece of state changed (url change).
▸ Can we do the same thing client-side?
CLIENT-SIDE FULL RE-RENDER
React Fundamentals - Jakarta JS, Apr 2016
EVENTS UPDATING STATE
THAT'S EXACTLY
HOW REACT WORKS.
VIEW IS A FUNCTION OF STATE:
▸ This means you can reason about your view just like you
used to do with server-generated views.
▸ Your view is a deterministic function of your state.

(the same state will always produce the same view)
▸ Even if you serialize that state, save it to disk and restore it
next week.
MORE EXCELLENT

THINGS WILL FOLLOW
Once you start down this path…
YOU START DISCOVERING BONUS STUFF LIKE:
▸ Trivial undo/redo
▸ Easy hot-reloading during development
▸ Atomic/Optimistic updates
▸ Imagine if an HTTP request fails, you just load a
previously stable state
▸ Time-travel debugging
▸ Imagine stepping back in time through your app state
LET'S LOOK AT

SOME REACT CODE…
REACT VERSION OF PREVIOUS EXAMPLE
EVENTS JUST UPDATE STATE!
…but there are
<div>s in your JS!
IN REALITY IT WILL LOOK MORE LIKE THIS:
REACT ELEMENTS
▸ That stuff is JSX and it’s really incredible
▸ It looks weird at first, but it is just [optional] sugar.
▸ JSX:
▸ Concise Syntax
▸ Static code analysis
▸ Directly compiles to JS
COMPOSITION OF COMPONENTS
▸ You build view components from other view components
▸ This is extremely powerful.
▸ Benefits:
▸ Code Reuse
▸ Separation of Concerns
▸ Clean layers of abstraction
React leaves it up to you to
separate concerns however
you like.
MOST PEOPLE HAVE:
▸ Presentational components:
▸ Purely for layout/styling
▸ CSS designers can work on these
▸ Container components:
▸ Know about data structure and logic
▸ Don’t know anything about layout/styling
So what's the price
you pay for using React?
REACT DRAWBACKS:
▸ Some setup complexity. Choices can be overwhelming.
▸ A moderate learning curve
▸ React will change the way you think about your UI. This
takes some getting used to.
▸ Rapidly evolving ecosystem.
VASTLY OUTWEIGHS THE
COST.
But what you get in return…
DEVELOPER EXPERIENCE
▸ Move fast: shorten the edit-reload cycle; spend less time
debugging
▸ Write testable code!
▸ Iterate with confidence and build more reliable
software.
▸ Learn once, write anywhere
▸ Web, iOS, Android, Mac/Windows, even console apps
: @sstur_
https://kodefox.com
Simon Sturmer
Thanks!

More Related Content

What's hot (20)

PDF
How to Redux
Ted Pennings
 
PPTX
Introduction to react_js
MicroPyramid .
 
PPTX
Reactjs
Neha Sharma
 
PDF
Introduction to react
kiranabburi
 
PPTX
Getting started with Redux js
Citrix
 
PPT
React js
Jai Santhosh
 
PDF
Best Practice-React
Yang Yang
 
PPT
Starting with Reactjs
Thinh VoXuan
 
PPSX
React introduction
Kashyap Parmar
 
PDF
React.js
Łukasz Kużyński
 
PPTX
Reactjs workshop
Ahmed rebai
 
PPTX
React js Online Training
Learntek1
 
PDF
React JS - Introduction
Sergey Romaneko
 
PDF
An introduction to React.js
Emanuele DelBono
 
PDF
JOSA TechTalks - Better Web Apps with React and Redux
Jordan Open Source Association
 
PPTX
Its time to React.js
Ritesh Mehrotra
 
PDF
Understanding Facebook's React.js
Federico Torre
 
PDF
Building Modern Web Applications using React and Redux
Maxime Najim
 
PPTX
React JS: A Secret Preview
valuebound
 
PPTX
React js Rahil Memon
RahilMemon5
 
How to Redux
Ted Pennings
 
Introduction to react_js
MicroPyramid .
 
Reactjs
Neha Sharma
 
Introduction to react
kiranabburi
 
Getting started with Redux js
Citrix
 
React js
Jai Santhosh
 
Best Practice-React
Yang Yang
 
Starting with Reactjs
Thinh VoXuan
 
React introduction
Kashyap Parmar
 
Reactjs workshop
Ahmed rebai
 
React js Online Training
Learntek1
 
React JS - Introduction
Sergey Romaneko
 
An introduction to React.js
Emanuele DelBono
 
JOSA TechTalks - Better Web Apps with React and Redux
Jordan Open Source Association
 
Its time to React.js
Ritesh Mehrotra
 
Understanding Facebook's React.js
Federico Torre
 
Building Modern Web Applications using React and Redux
Maxime Najim
 
React JS: A Secret Preview
valuebound
 
React js Rahil Memon
RahilMemon5
 

Viewers also liked (18)

PDF
BWD Apr 2012 - Disruptive innovation
Simon Sturmer
 
PPTX
The disaster of mutable state
kenbot
 
PPTX
Teaching old java script new tricks
Simon Sturmer
 
PDF
APPSCoast Pitch Deck
Riza Fahmi
 
PDF
Mobile Programming - Network Universitas Budi Luhur
Riza Fahmi
 
PDF
Meteor Talk At TokoPedia
Riza Fahmi
 
PPTX
Sony lazuardi native mobile app with javascript
PHP Indonesia
 
PDF
Building Scalable, Highly Concurrent & Fault Tolerant Systems - Lessons Learned
Jonas Bonér
 
PDF
Muhammad azamuddin introduction-to-reactjs
PHP Indonesia
 
PDF
Fellow Developers, Let's Discover Your Superpower
Riza Fahmi
 
PDF
Styling Your React App
Riza Fahmi
 
PDF
Mobile Programming - 3 UDP
Riza Fahmi
 
PDF
Serverless NodeJS With AWS Lambda
Riza Fahmi
 
PDF
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
Riza Fahmi
 
PPTX
Basic Operating System
Nizar Lazuardy Firmansyah
 
PDF
React Webinar With CodePolitan
Riza Fahmi
 
PDF
Team 101: How to Build The A Team For Your Startup
Riza Fahmi
 
PDF
reveal.js 3.0.0
Hakim El Hattab
 
BWD Apr 2012 - Disruptive innovation
Simon Sturmer
 
The disaster of mutable state
kenbot
 
Teaching old java script new tricks
Simon Sturmer
 
APPSCoast Pitch Deck
Riza Fahmi
 
Mobile Programming - Network Universitas Budi Luhur
Riza Fahmi
 
Meteor Talk At TokoPedia
Riza Fahmi
 
Sony lazuardi native mobile app with javascript
PHP Indonesia
 
Building Scalable, Highly Concurrent & Fault Tolerant Systems - Lessons Learned
Jonas Bonér
 
Muhammad azamuddin introduction-to-reactjs
PHP Indonesia
 
Fellow Developers, Let's Discover Your Superpower
Riza Fahmi
 
Styling Your React App
Riza Fahmi
 
Mobile Programming - 3 UDP
Riza Fahmi
 
Serverless NodeJS With AWS Lambda
Riza Fahmi
 
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
Riza Fahmi
 
Basic Operating System
Nizar Lazuardy Firmansyah
 
React Webinar With CodePolitan
Riza Fahmi
 
Team 101: How to Build The A Team For Your Startup
Riza Fahmi
 
reveal.js 3.0.0
Hakim El Hattab
 
Ad

Similar to React Fundamentals - Jakarta JS, Apr 2016 (20)

PPTX
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
PDF
Welcome to React & Flux !
Ritesh Kumar
 
PPTX
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
PDF
theory-slides-vueh3urh4ur4ur4r44oirj4riu4ri
paridhiagarwal129
 
PPTX
React.js at Cortex
Geoff Harcourt
 
PPTX
React js
Nikhil Karkra
 
PPTX
React js for beginners
Alessandro Valenti
 
DOCX
Skill practical javascript diy projects
SkillPracticalEdTech
 
PDF
Tech Talk on ReactJS
Atlogys Technical Consulting
 
PPSX
REACTJS1.ppsx
IshwarSingh501217
 
PDF
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
PDF
React in Action ( PDFDrive ).pdf
almako2
 
PPTX
001. Introduction about React
Binh Quan Duc
 
PPTX
ReactJS Code Impact
Raymond McDermott
 
PPTX
react js training|react js training in mumbai|React js classes in mumbai
EsgbnmkPhcm
 
PPTX
React ppt
Naresh Thamizharasan
 
PPTX
What is ReactJS?
Albiorix Technology
 
PDF
Review on React JS
ijtsrd
 
PPTX
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
PPTX
reactJS
Syam Santhosh
 
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
Welcome to React & Flux !
Ritesh Kumar
 
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
theory-slides-vueh3urh4ur4ur4r44oirj4riu4ri
paridhiagarwal129
 
React.js at Cortex
Geoff Harcourt
 
React js
Nikhil Karkra
 
React js for beginners
Alessandro Valenti
 
Skill practical javascript diy projects
SkillPracticalEdTech
 
Tech Talk on ReactJS
Atlogys Technical Consulting
 
REACTJS1.ppsx
IshwarSingh501217
 
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
React in Action ( PDFDrive ).pdf
almako2
 
001. Introduction about React
Binh Quan Duc
 
ReactJS Code Impact
Raymond McDermott
 
react js training|react js training in mumbai|React js classes in mumbai
EsgbnmkPhcm
 
What is ReactJS?
Albiorix Technology
 
Review on React JS
ijtsrd
 
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
reactJS
Syam Santhosh
 
Ad

Recently uploaded (20)

PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
Designing Production-Ready AI Agents
Kunal Rai
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Biography of Daniel Podor.pdf
Daniel Podor
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Designing Production-Ready AI Agents
Kunal Rai
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 

React Fundamentals - Jakarta JS, Apr 2016

  • 2. Simon Sturmer : @sstur_ CTO / Fouder - KodeFox
  • 4. WHAT IS REACT? ▸ So you've heard the hype, but what is React? ▸ React is an opinionated View library. ▸ It is a fundamentally different way to build UIs. ▸ It leads to thinking in terms of pure functions and immutability and other good practices.
  • 5. WHY REACT? ▸ Why are so many top companies choosing React? ▸ Netflix, Yahoo, Apple, AirBnB, WhatsApp, CloudFlare, Dropbox, Instagram, Twitter, Uber, WordPress even SaleStock Indonesia ▸ Performance, Testability, Code Reuse ▸ Developer Experience.
  • 6. WHY REACT? ▸ How is React different from Angular/Ember/etc? ▸ Everything is a component. ▸ A component is a pure function of application state. ▸ Components can be reused, composed to create other components, isolated for testing. ▸ UI is easy to reason about as state changes over time.
  • 7. REACT IS A BUSINESS DECISION, NOT JUST A TECHNOLOGY CHOICE!
  • 8. REACT AS A BUSINESS DECISION ▸ Fewer, more versatile software engineers! ▸ Same dev team! Web, iOS, Android, Desktop ▸ Improved Testability, Reliability ▸ Performant by Default ▸ Real Code Reuse ▸ Velocity: shorten the edit-reload cycle; less time debugging ▸ Future proof: As your software evolves, replace individual components.
  • 9. WHY BUSINESSES STILL CHOOSE ANGULAR/EMBER? ▸ New tech can be overwhelming. Where to start? ▸ How to train your dev team? ▸ Some have large, legacy code-bases with a lot of resources invested.
  • 11. WHAT PROBLEM DOES REACT TRY TO SOLVE? ▸ App state changing over time is hard to reason about. ▸ UI components get out of sync with each other and it's hard to debug. ▸ When changes happen, we have to reach deep into our view and mutate objects.
  • 12. SHARED MUTABLE STATE IS THE ROOT OF ALL EVIL Pete Hunt, React.js Conf 2015 REACT + REDUX GIVES YOU IMMUTABLE STATE
  • 13. REMEMBER THE OLD DAYS? ▸ Server-side Rendering ▸ Generating HTML views was easy! ▸ Why? … because we had the full application state at one moment in time (a snapshot) ▸ All we have to do is query stuff and generate HTML from that stuff. ▸ When an action happens, re-generate the entire view!
  • 15. SPRINKLING JS ON TOP ▸ Web apps slowly started doing more client-side ▸ DOM Manipulation: jQuery ▸ Client-side templating: mustache, handlebars ▸ Must wire-up events every time you generate new DOM ▸ Still need to manipulate the DOM!
  • 17. THE PROBLEM: ▸ There's way too much complexity around keeping your app in a consistent state. ▸ It's almost impossible to reason about. ▸ The bookkeeping makes for a poor developer experience.
  • 18. THE SOLUTION: ▸ We never had that problem with server-side rendering! ▸ … because we just re-generated the entire view when a piece of state changed (url change). ▸ Can we do the same thing client-side?
  • 23. VIEW IS A FUNCTION OF STATE: ▸ This means you can reason about your view just like you used to do with server-generated views. ▸ Your view is a deterministic function of your state.
 (the same state will always produce the same view) ▸ Even if you serialize that state, save it to disk and restore it next week.
  • 24. MORE EXCELLENT
 THINGS WILL FOLLOW Once you start down this path…
  • 25. YOU START DISCOVERING BONUS STUFF LIKE: ▸ Trivial undo/redo ▸ Easy hot-reloading during development ▸ Atomic/Optimistic updates ▸ Imagine if an HTTP request fails, you just load a previously stable state ▸ Time-travel debugging ▸ Imagine stepping back in time through your app state
  • 26. LET'S LOOK AT
 SOME REACT CODE…
  • 27. REACT VERSION OF PREVIOUS EXAMPLE
  • 29. …but there are <div>s in your JS!
  • 30. IN REALITY IT WILL LOOK MORE LIKE THIS:
  • 31. REACT ELEMENTS ▸ That stuff is JSX and it’s really incredible ▸ It looks weird at first, but it is just [optional] sugar. ▸ JSX: ▸ Concise Syntax ▸ Static code analysis ▸ Directly compiles to JS
  • 32. COMPOSITION OF COMPONENTS ▸ You build view components from other view components ▸ This is extremely powerful. ▸ Benefits: ▸ Code Reuse ▸ Separation of Concerns ▸ Clean layers of abstraction
  • 33. React leaves it up to you to separate concerns however you like.
  • 34. MOST PEOPLE HAVE: ▸ Presentational components: ▸ Purely for layout/styling ▸ CSS designers can work on these ▸ Container components: ▸ Know about data structure and logic ▸ Don’t know anything about layout/styling
  • 35. So what's the price you pay for using React?
  • 36. REACT DRAWBACKS: ▸ Some setup complexity. Choices can be overwhelming. ▸ A moderate learning curve ▸ React will change the way you think about your UI. This takes some getting used to. ▸ Rapidly evolving ecosystem.
  • 37. VASTLY OUTWEIGHS THE COST. But what you get in return…
  • 38. DEVELOPER EXPERIENCE ▸ Move fast: shorten the edit-reload cycle; spend less time debugging ▸ Write testable code! ▸ Iterate with confidence and build more reliable software. ▸ Learn once, write anywhere ▸ Web, iOS, Android, Mac/Windows, even console apps