SlideShare a Scribd company logo
A React Journey
A tour of the latest trends in the React ecosystem
JS Frontend Developer at LinkMe Srl
Twitter: @_denb
In love with React and Javascript in general.
I’m a 7-month-old dad
Daniele Bertella
JS Frontend Jr Developer at LinkMe Srl
Twitter: @paolorovella
In love with React and sushi, i’m an
incurable tv shows binge watcher
Paolo Rovella
React Ecosystem
React
JSX, State/Props,
HoC, Routing
State management
Redux, Mobx
Tools
Babel, Webpack, CSS
Modules, Testing
React
React is a JavaScript library for
creating user interfaces
https://facebook.github.io/react
ReactMain concepts
Just the UI
React is only concerned
about rendering UI
Virtual DOM
React uses a Virtual DOM
Diff implementation for
ultra-high performance
Data Flow
React introduces one-way
reactive data flow
Components
ReactA basic component
JSX is a XML-like syntax
extension to ECMAScript
JSX uses className because
“class” in JavaScript is a
reserved word
ReactProps
Input data that is passed into the
component and can be accessed
via this.props
The propTypes object allows you
to validate props being passed to
your components
PropTypes validation provided
https://facebook.github.io/react/docs/reusable-components.html#prop-validation
ReactState
Internal state data
A component can maintain internal
state data (accessed via this.state)
Re-render on state changes
When a component's state data
changes, the rendered markup will
be updated by re-invoking render()
ReactComponent Lifecycles
Various methods are executed at
specific points in a component's
lifecycle
https://facebook.github.io/react/docs/component-specs.html#lifecycle-methods
React
ECMAScript 6 (ES6) is the upcoming sixth major release of
the ECMAScript language specification.
ES6 support is different among browsers
(https://kangax.github.io/compat-table/es6/)
You can use ES6 today thanks to transpilers like Babel
ECMAScript 6 (ES6)
Babel
Javascript compiler
Transpile ES6/ES7 in ES5
(Classes / Destructuring / Arrow functions /
Spread operator ...)
http://babeljs.io
http://babeljs.io/docs/learn-es2015/
ReactES5 to ES6 Classes
ECMAScript 6 equivalents in ES5 by @addyosmani
https://github.com/addyosmani/es6-equivalents-in-es5
React
ES6 Destructuring
ES6 Arrow function
Expression that make it possible to
extract data from arrays or object into
dinstinct variables
Shorter syntax compared to function
expressions and binds the “this” value
(not its own this). They are always
anonymous
React
ES6 Object Spread operator
ES6 Decorators
Copy properties from one object to another.
The specification order is important
Syntactic sugar which lets you
annotate and modify classes at
design time
ReactStateless Functional Components
Kill boilerplate code
Dumb and predictable
component
No state, no component
lifecycles
ReactHigh Order Components
Reuse other components
functionalities
Reduce duplication of code
ReactHigh Order Components
Thanks @cef62 (Matteo Ronchi)
https://speakerdeck.com/cef62/higher-order-
components-in-react-at-voxxed-days-ticino-2016
ReactRouting (react-router) https://github.com/reactjs/react-router
State management
ReduxBy Dan Abramov (@dan_abramov)
https://github.com/reactjs/redux
Predictable state container for JavaScript apps.
Three principles
- Single source of truth
- State is read only
- Changes are made with pure functions
ReduxApp state
App state described as a plain object
This object is like a “model” except
that there are no setters
ReduxActions
The only way to mutate the state is to emit an action, an object
describing what happened
ReduxReducers
A function that takes previous state
and action as arguments, and
returns the next state of the app
Split reducers in smaller functions
managing parts of the state
ReduxReducers
A reducer that manage the complete state
can call other small reducers
ReduxAPI
combineReducers
Combine different
reducers in one
createStore
Two arguments, combined
reducers and persisted state
(optional)
Redux
subscribe
Adds a change listener. Called any time an
action is dispatched, and some part of the state
tree may potentially have changed
getState
Returns an object with the current state tree
of your application
dispatch
Dispatches an action. This is the only way to
trigger a state change
Store
Reduxreact-redux
React bindings for Redux embrace the idea of separating
presentational and container components.
Provider
makes the store available to all
container components in the app
only need to use it once when you
render the root component
Reduxreact-redux
Reduxreact-redux
connect(params)(Component)
connects a React component
to a Redux store.
returns a new, connected
component class
Reduxreact-redux
mapStateToProps
a function that tell how to transform the
current Redux store state into the props
you want to pass.
mapDispatchToProps
a function that receives dispatch()
method and returns a callback props.
ReduxMiddlewares
Suggested way to extend Redux with
custom functionality
They are called after an action is
dispatched and before it reaches the
reducer
Multiple middlewares can be combined
together
Redux Saga middleware let you create Sagas, which are
generators responsible for orchestrating complex/asynchronous
operations, to gather all your side effects logic in a central place
Redux
redux-thunk
https://github.com/gaearon/redux-thunk
Middlewares
Redux Thunk middleware allows you to write action creators that
return a function instead of an action
The thunk can be used to delay the dispatch of an action, or to
dispatch only if a certain condition is met
redux-saga
https://github.com/yelouafi/redux-saga
MobXBy Michel Weststrate (@mweststrate)
https://github.com/mobxjs/mobx
MobX is a library that makes state management
simple and scalable by transparently applying
functional reactive programming
Functional reactive programming
Functional reactive programming is programming
with asynchronous data streams which you can
listen to and react accordingly
The introduction to Reactive Programming you've been missing
https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
MobXStore (observable/computed)
@observable state
observable capabilities to objects, arrays
and class instances annotating properties
with the @observable decorator
@computed
values that will be derived automatically
when relevant data is modified
@action
action is anything that modify
the state and is always triggered
by some event (DOM events,
websockets etc)
MobXStore (action)
MobX
@observer
observer function / decorator is used
to turn ReactJS components into
reactive components.
In this component store can be
passed as a prop
mobx-react
MobXFlow
API overview
https://mobxjs.github.io/mobx/refguide/api.html
In-depth explanation of MobX
https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-
explanation-of-mobservable-55995262a254
One more thing...
https://speakerdeck.com/paolorovella/react-native
A React Journey
A React Journey
Ad

More Related Content

What's hot (20)

Replicating production on your laptop using the magic of containers v2
Replicating production on your laptop using the magic of containers v2Replicating production on your laptop using the magic of containers v2
Replicating production on your laptop using the magic of containers v2
Jamie Coleman
 
React custom renderers
React custom renderersReact custom renderers
React custom renderers
Giovanni Jiayi Hu
 
Kubernetes Operators: Rob Szumski
Kubernetes Operators: Rob SzumskiKubernetes Operators: Rob Szumski
Kubernetes Operators: Rob Szumski
Redis Labs
 
Reactive Streams and RxJava2
Reactive Streams and RxJava2Reactive Streams and RxJava2
Reactive Streams and RxJava2
Yakov Fain
 
Operator Framework Overview
Operator Framework OverviewOperator Framework Overview
Operator Framework Overview
Rob Szumski
 
The History of React-Hot-Loader
The History of React-Hot-LoaderThe History of React-Hot-Loader
The History of React-Hot-Loader
Anton Korzunov
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
Hamid Ghorbani
 
Do's and Do not's about p2
Do's and Do not's about p2Do's and Do not's about p2
Do's and Do not's about p2
Pascal Rapicault
 
[Fevr] Can't live if livin' is without rendering
[Fevr] Can't live if livin' is without rendering[Fevr] Can't live if livin' is without rendering
[Fevr] Can't live if livin' is without rendering
Giovanni Jiayi Hu
 
Spring Boot
Spring BootSpring Boot
Spring Boot
HongSeong Jeon
 
React: JSX and Top Level API
React: JSX and Top Level APIReact: JSX and Top Level API
React: JSX and Top Level API
Fabio Biondi
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Elixir Club
 
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan KustAndroid Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
Infinum
 
Use open stack to run java programs inside a Docker container
Use open stack to run java programs inside a Docker containerUse open stack to run java programs inside a Docker container
Use open stack to run java programs inside a Docker container
Miano Sebastiano
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
William Marques
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring Framework
Dmytro Chyzhykov
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
Ryan Cuprak
 
Concurrent Rendering Adventures in React 18
Concurrent Rendering Adventures in React 18Concurrent Rendering Adventures in React 18
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
 
Lecture5
Lecture5Lecture5
Lecture5
Châu Thanh Chương
 
Kubernetes
KubernetesKubernetes
Kubernetes
Lhouceine OUHAMZA
 
Replicating production on your laptop using the magic of containers v2
Replicating production on your laptop using the magic of containers v2Replicating production on your laptop using the magic of containers v2
Replicating production on your laptop using the magic of containers v2
Jamie Coleman
 
Kubernetes Operators: Rob Szumski
Kubernetes Operators: Rob SzumskiKubernetes Operators: Rob Szumski
Kubernetes Operators: Rob Szumski
Redis Labs
 
Reactive Streams and RxJava2
Reactive Streams and RxJava2Reactive Streams and RxJava2
Reactive Streams and RxJava2
Yakov Fain
 
Operator Framework Overview
Operator Framework OverviewOperator Framework Overview
Operator Framework Overview
Rob Szumski
 
The History of React-Hot-Loader
The History of React-Hot-LoaderThe History of React-Hot-Loader
The History of React-Hot-Loader
Anton Korzunov
 
Do's and Do not's about p2
Do's and Do not's about p2Do's and Do not's about p2
Do's and Do not's about p2
Pascal Rapicault
 
[Fevr] Can't live if livin' is without rendering
[Fevr] Can't live if livin' is without rendering[Fevr] Can't live if livin' is without rendering
[Fevr] Can't live if livin' is without rendering
Giovanni Jiayi Hu
 
React: JSX and Top Level API
React: JSX and Top Level APIReact: JSX and Top Level API
React: JSX and Top Level API
Fabio Biondi
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Elixir Club
 
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan KustAndroid Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
Infinum
 
Use open stack to run java programs inside a Docker container
Use open stack to run java programs inside a Docker containerUse open stack to run java programs inside a Docker container
Use open stack to run java programs inside a Docker container
Miano Sebastiano
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
William Marques
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring Framework
Dmytro Chyzhykov
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
Ryan Cuprak
 
Concurrent Rendering Adventures in React 18
Concurrent Rendering Adventures in React 18Concurrent Rendering Adventures in React 18
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
 

Similar to A React Journey (20)

React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
Remo Jansen
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
React gsg presentation with ryan jung & elias malik
React   gsg presentation with ryan jung & elias malikReact   gsg presentation with ryan jung & elias malik
React gsg presentation with ryan jung & elias malik
Lama K Banna
 
All about React Js
All about React JsAll about React Js
All about React Js
Gargi Raghav
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
React ppt
React pptReact ppt
React ppt
Naresh Thamizharasan
 
React js introduction about it's features
React js introduction about it's featuresReact js introduction about it's features
React js introduction about it's features
SaiM947604
 
ReactJS (1)
ReactJS (1)ReactJS (1)
ReactJS (1)
George Tony
 
React & ES6 Intro
React & ES6 IntroReact & ES6 Intro
React & ES6 Intro
Yair Aviner
 
ReactCodemod: An automated approach for refactoring class based components to...
ReactCodemod: An automated approach for refactoring class based components to...ReactCodemod: An automated approach for refactoring class based components to...
ReactCodemod: An automated approach for refactoring class based components to...
IRJET Journal
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR3
 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptx
AnmolPandita7
 
Techpaathshala ReactJS .pdf
Techpaathshala ReactJS .pdfTechpaathshala ReactJS .pdf
Techpaathshala ReactJS .pdf
Techpaathshala
 
Spfx with react redux
Spfx with react reduxSpfx with react redux
Spfx with react redux
Rajesh Kumar
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
Sergey Romaneko
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHatReact Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
Scholarhat
 
100 React Interview questions 2024.pptx.pdf
100 React Interview questions 2024.pptx.pdf100 React Interview questions 2024.pptx.pdf
100 React Interview questions 2024.pptx.pdf
codevincent624
 
The Road To Redux
The Road To ReduxThe Road To Redux
The Road To Redux
Jeffrey Sanchez
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
dhanushkacnd
 
OttawaJS - React
OttawaJS - ReactOttawaJS - React
OttawaJS - React
rbl002
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
Remo Jansen
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
React gsg presentation with ryan jung & elias malik
React   gsg presentation with ryan jung & elias malikReact   gsg presentation with ryan jung & elias malik
React gsg presentation with ryan jung & elias malik
Lama K Banna
 
All about React Js
All about React JsAll about React Js
All about React Js
Gargi Raghav
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
React js introduction about it's features
React js introduction about it's featuresReact js introduction about it's features
React js introduction about it's features
SaiM947604
 
React & ES6 Intro
React & ES6 IntroReact & ES6 Intro
React & ES6 Intro
Yair Aviner
 
ReactCodemod: An automated approach for refactoring class based components to...
ReactCodemod: An automated approach for refactoring class based components to...ReactCodemod: An automated approach for refactoring class based components to...
ReactCodemod: An automated approach for refactoring class based components to...
IRJET Journal
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR3
 
Techpaathshala ReactJS .pdf
Techpaathshala ReactJS .pdfTechpaathshala ReactJS .pdf
Techpaathshala ReactJS .pdf
Techpaathshala
 
Spfx with react redux
Spfx with react reduxSpfx with react redux
Spfx with react redux
Rajesh Kumar
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHatReact Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
Scholarhat
 
100 React Interview questions 2024.pptx.pdf
100 React Interview questions 2024.pptx.pdf100 React Interview questions 2024.pptx.pdf
100 React Interview questions 2024.pptx.pdf
codevincent624
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
dhanushkacnd
 
OttawaJS - React
OttawaJS - ReactOttawaJS - React
OttawaJS - React
rbl002
 
Ad

More from LinkMe Srl (7)

Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
LinkMe Srl
 
Webdriver.io
Webdriver.io Webdriver.io
Webdriver.io
LinkMe Srl
 
Angular Intermediate
Angular IntermediateAngular Intermediate
Angular Intermediate
LinkMe Srl
 
NodeJS
NodeJSNodeJS
NodeJS
LinkMe Srl
 
Angular js quickstart
Angular js quickstartAngular js quickstart
Angular js quickstart
LinkMe Srl
 
M&M - MeanMilan @CodeMotionMilan
M&M - MeanMilan @CodeMotionMilanM&M - MeanMilan @CodeMotionMilan
M&M - MeanMilan @CodeMotionMilan
LinkMe Srl
 
Presentazione Codemotion
Presentazione Codemotion Presentazione Codemotion
Presentazione Codemotion
LinkMe Srl
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
LinkMe Srl
 
Angular Intermediate
Angular IntermediateAngular Intermediate
Angular Intermediate
LinkMe Srl
 
Angular js quickstart
Angular js quickstartAngular js quickstart
Angular js quickstart
LinkMe Srl
 
M&M - MeanMilan @CodeMotionMilan
M&M - MeanMilan @CodeMotionMilanM&M - MeanMilan @CodeMotionMilan
M&M - MeanMilan @CodeMotionMilan
LinkMe Srl
 
Presentazione Codemotion
Presentazione Codemotion Presentazione Codemotion
Presentazione Codemotion
LinkMe Srl
 
Ad

Recently uploaded (20)

Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 

A React Journey

  • 1. A React Journey A tour of the latest trends in the React ecosystem
  • 2. JS Frontend Developer at LinkMe Srl Twitter: @_denb In love with React and Javascript in general. I’m a 7-month-old dad Daniele Bertella
  • 3. JS Frontend Jr Developer at LinkMe Srl Twitter: @paolorovella In love with React and sushi, i’m an incurable tv shows binge watcher Paolo Rovella
  • 4. React Ecosystem React JSX, State/Props, HoC, Routing State management Redux, Mobx Tools Babel, Webpack, CSS Modules, Testing
  • 5. React React is a JavaScript library for creating user interfaces https://facebook.github.io/react
  • 6. ReactMain concepts Just the UI React is only concerned about rendering UI Virtual DOM React uses a Virtual DOM Diff implementation for ultra-high performance Data Flow React introduces one-way reactive data flow
  • 8. ReactA basic component JSX is a XML-like syntax extension to ECMAScript JSX uses className because “class” in JavaScript is a reserved word
  • 9. ReactProps Input data that is passed into the component and can be accessed via this.props The propTypes object allows you to validate props being passed to your components PropTypes validation provided https://facebook.github.io/react/docs/reusable-components.html#prop-validation
  • 10. ReactState Internal state data A component can maintain internal state data (accessed via this.state) Re-render on state changes When a component's state data changes, the rendered markup will be updated by re-invoking render()
  • 11. ReactComponent Lifecycles Various methods are executed at specific points in a component's lifecycle https://facebook.github.io/react/docs/component-specs.html#lifecycle-methods
  • 12. React ECMAScript 6 (ES6) is the upcoming sixth major release of the ECMAScript language specification. ES6 support is different among browsers (https://kangax.github.io/compat-table/es6/) You can use ES6 today thanks to transpilers like Babel ECMAScript 6 (ES6)
  • 13. Babel Javascript compiler Transpile ES6/ES7 in ES5 (Classes / Destructuring / Arrow functions / Spread operator ...) http://babeljs.io http://babeljs.io/docs/learn-es2015/
  • 14. ReactES5 to ES6 Classes ECMAScript 6 equivalents in ES5 by @addyosmani https://github.com/addyosmani/es6-equivalents-in-es5
  • 15. React ES6 Destructuring ES6 Arrow function Expression that make it possible to extract data from arrays or object into dinstinct variables Shorter syntax compared to function expressions and binds the “this” value (not its own this). They are always anonymous
  • 16. React ES6 Object Spread operator ES6 Decorators Copy properties from one object to another. The specification order is important Syntactic sugar which lets you annotate and modify classes at design time
  • 17. ReactStateless Functional Components Kill boilerplate code Dumb and predictable component No state, no component lifecycles
  • 18. ReactHigh Order Components Reuse other components functionalities Reduce duplication of code
  • 19. ReactHigh Order Components Thanks @cef62 (Matteo Ronchi) https://speakerdeck.com/cef62/higher-order- components-in-react-at-voxxed-days-ticino-2016
  • 22. ReduxBy Dan Abramov (@dan_abramov) https://github.com/reactjs/redux Predictable state container for JavaScript apps. Three principles - Single source of truth - State is read only - Changes are made with pure functions
  • 23. ReduxApp state App state described as a plain object This object is like a “model” except that there are no setters
  • 24. ReduxActions The only way to mutate the state is to emit an action, an object describing what happened
  • 25. ReduxReducers A function that takes previous state and action as arguments, and returns the next state of the app Split reducers in smaller functions managing parts of the state
  • 26. ReduxReducers A reducer that manage the complete state can call other small reducers
  • 27. ReduxAPI combineReducers Combine different reducers in one createStore Two arguments, combined reducers and persisted state (optional)
  • 28. Redux subscribe Adds a change listener. Called any time an action is dispatched, and some part of the state tree may potentially have changed getState Returns an object with the current state tree of your application dispatch Dispatches an action. This is the only way to trigger a state change Store
  • 29. Reduxreact-redux React bindings for Redux embrace the idea of separating presentational and container components.
  • 30. Provider makes the store available to all container components in the app only need to use it once when you render the root component Reduxreact-redux
  • 31. Reduxreact-redux connect(params)(Component) connects a React component to a Redux store. returns a new, connected component class
  • 32. Reduxreact-redux mapStateToProps a function that tell how to transform the current Redux store state into the props you want to pass. mapDispatchToProps a function that receives dispatch() method and returns a callback props.
  • 33. ReduxMiddlewares Suggested way to extend Redux with custom functionality They are called after an action is dispatched and before it reaches the reducer Multiple middlewares can be combined together
  • 34. Redux Saga middleware let you create Sagas, which are generators responsible for orchestrating complex/asynchronous operations, to gather all your side effects logic in a central place Redux redux-thunk https://github.com/gaearon/redux-thunk Middlewares Redux Thunk middleware allows you to write action creators that return a function instead of an action The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met redux-saga https://github.com/yelouafi/redux-saga
  • 35. MobXBy Michel Weststrate (@mweststrate) https://github.com/mobxjs/mobx MobX is a library that makes state management simple and scalable by transparently applying functional reactive programming
  • 36. Functional reactive programming Functional reactive programming is programming with asynchronous data streams which you can listen to and react accordingly The introduction to Reactive Programming you've been missing https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
  • 37. MobXStore (observable/computed) @observable state observable capabilities to objects, arrays and class instances annotating properties with the @observable decorator @computed values that will be derived automatically when relevant data is modified
  • 38. @action action is anything that modify the state and is always triggered by some event (DOM events, websockets etc) MobXStore (action)
  • 39. MobX @observer observer function / decorator is used to turn ReactJS components into reactive components. In this component store can be passed as a prop mobx-react
  • 40. MobXFlow API overview https://mobxjs.github.io/mobx/refguide/api.html In-depth explanation of MobX https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth- explanation-of-mobservable-55995262a254