Suche senden
Hochladen
A full introductory guide to React
•
1 gefällt mir
•
606 views
Jean Carlo Emer
Folgen
From React basics to React server render.
Weniger lesen
Mehr lesen
Technologie
Diashow-Anzeige
Melden
Teilen
Diashow-Anzeige
Melden
Teilen
1 von 79
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
React – Structure Container Component In Meteor
React – Structure Container Component In Meteor
Designveloper
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
Eric Deng
Switch to React.js from AngularJS developer
Switch to React.js from AngularJS developer
Eugene Zharkov
React render props
React render props
Saikat Samanta
Learn react-js
Learn react-js
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
JSON Part 3: Asynchronous Ajax & JQuery Deferred
JSON Part 3: Asynchronous Ajax & JQuery Deferred
Jeff Fox
Intro to React
Intro to React
Eric Westfall
ReactJS for Beginners
ReactJS for Beginners
Oswald Campesato
Empfohlen
React – Structure Container Component In Meteor
React – Structure Container Component In Meteor
Designveloper
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
Eric Deng
Switch to React.js from AngularJS developer
Switch to React.js from AngularJS developer
Eugene Zharkov
React render props
React render props
Saikat Samanta
Learn react-js
Learn react-js
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
JSON Part 3: Asynchronous Ajax & JQuery Deferred
JSON Part 3: Asynchronous Ajax & JQuery Deferred
Jeff Fox
Intro to React
Intro to React
Eric Westfall
ReactJS for Beginners
ReactJS for Beginners
Oswald Campesato
[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
React JS - A quick introduction tutorial
React JS - A quick introduction tutorial
Mohammed Fazuluddin
Introduction to React JS
Introduction to React JS
Arno Lordkronos
ReactJs presentation
ReactJs presentation
nishasowdri
Struts tutorial
Struts tutorial
OPENLANE
React js for beginners
React js for beginners
Alessandro Valenti
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
Remo Jansen
Redux vs Alt
Redux vs Alt
Uldis Sturms
Intro to ReactJS
Intro to ReactJS
Harvard Web Working Group
Academy PRO: React JS
Academy PRO: React JS
Binary Studio
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture components
Debora Gomez Bertoli
Better web apps with React and Redux
Better web apps with React and Redux
Ali Sa'o
React + Redux. Best practices
React + Redux. Best practices
Clickky
React, Flux and a little bit of Redux
React, Flux and a little bit of Redux
Ny Fanilo Andrianjafy, B.Eng.
Introduction to React JS for beginners
Introduction to React JS for beginners
Varun Raj
React & redux
React & redux
Cédric Hartland
Redux training
Redux training
dasersoft
React and redux
React and redux
Mystic Coders, LLC
React JS part 1
React JS part 1
Diluka Wittahachchige
Its time to React.js
Its time to React.js
Ritesh Mehrotra
ReactJS
ReactJS
Ram Murat Sharma
Intro react js
Intro react js
Vijayakanth MP
Weitere ähnliche Inhalte
Was ist angesagt?
[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
React JS - A quick introduction tutorial
React JS - A quick introduction tutorial
Mohammed Fazuluddin
Introduction to React JS
Introduction to React JS
Arno Lordkronos
ReactJs presentation
ReactJs presentation
nishasowdri
Struts tutorial
Struts tutorial
OPENLANE
React js for beginners
React js for beginners
Alessandro Valenti
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
Remo Jansen
Redux vs Alt
Redux vs Alt
Uldis Sturms
Intro to ReactJS
Intro to ReactJS
Harvard Web Working Group
Academy PRO: React JS
Academy PRO: React JS
Binary Studio
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture components
Debora Gomez Bertoli
Better web apps with React and Redux
Better web apps with React and Redux
Ali Sa'o
React + Redux. Best practices
React + Redux. Best practices
Clickky
React, Flux and a little bit of Redux
React, Flux and a little bit of Redux
Ny Fanilo Andrianjafy, B.Eng.
Introduction to React JS for beginners
Introduction to React JS for beginners
Varun Raj
React & redux
React & redux
Cédric Hartland
Redux training
Redux training
dasersoft
React and redux
React and redux
Mystic Coders, LLC
React JS part 1
React JS part 1
Diluka Wittahachchige
Its time to React.js
Its time to React.js
Ritesh Mehrotra
Was ist angesagt?
(20)
[Final] ReactJS presentation
[Final] ReactJS presentation
React JS - A quick introduction tutorial
React JS - A quick introduction tutorial
Introduction to React JS
Introduction to React JS
ReactJs presentation
ReactJs presentation
Struts tutorial
Struts tutorial
React js for beginners
React js for beginners
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
Redux vs Alt
Redux vs Alt
Intro to ReactJS
Intro to ReactJS
Academy PRO: React JS
Academy PRO: React JS
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture components
Better web apps with React and Redux
Better web apps with React and Redux
React + Redux. Best practices
React + Redux. Best practices
React, Flux and a little bit of Redux
React, Flux and a little bit of Redux
Introduction to React JS for beginners
Introduction to React JS for beginners
React & redux
React & redux
Redux training
Redux training
React and redux
React and redux
React JS part 1
React JS part 1
Its time to React.js
Its time to React.js
Ähnlich wie A full introductory guide to React
ReactJS
ReactJS
Ram Murat Sharma
Intro react js
Intro react js
Vijayakanth MP
Introduction to React for Frontend Developers
Introduction to React for Frontend Developers
Sergio Nakamura
React & The Art of Managing Complexity
React & The Art of Managing Complexity
Ryan Anklam
React Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptx
BOSC Tech Labs
React/Redux
React/Redux
Durgesh Vaishnav
Let's react - Meetup
Let's react - Meetup
RAJNISH KATHAROTIYA
React - Start learning today
React - Start learning today
Nitin Tyagi
React - An Introduction
React - An Introduction
Tyler Johnston
Fundamental concepts of react js
Fundamental concepts of react js
StephieJohn
React for Re-use: Creating UI Components with Confluence Connect
React for Re-use: Creating UI Components with Confluence Connect
Atlassian
Combining Angular and React Together
Combining Angular and React Together
Sebastian Pederiva
react-en.pdf
react-en.pdf
ssuser65180a
React JS: A Secret Preview
React JS: A Secret Preview
valuebound
OttawaJS - React
OttawaJS - React
rbl002
Build web apps with react js
Build web apps with react js
dhanushkacnd
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Luciano Mammino
React Native for multi-platform mobile applications
React Native for multi-platform mobile applications
Matteo Manchi
React & Redux for noobs
React & Redux for noobs
[T]echdencias
ReactJS.pptx
ReactJS.pptx
SamyakShetty2
Ähnlich wie A full introductory guide to React
(20)
ReactJS
ReactJS
Intro react js
Intro react js
Introduction to React for Frontend Developers
Introduction to React for Frontend Developers
React & The Art of Managing Complexity
React & The Art of Managing Complexity
React Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptx
React/Redux
React/Redux
Let's react - Meetup
Let's react - Meetup
React - Start learning today
React - Start learning today
React - An Introduction
React - An Introduction
Fundamental concepts of react js
Fundamental concepts of react js
React for Re-use: Creating UI Components with Confluence Connect
React for Re-use: Creating UI Components with Confluence Connect
Combining Angular and React Together
Combining Angular and React Together
react-en.pdf
react-en.pdf
React JS: A Secret Preview
React JS: A Secret Preview
OttawaJS - React
OttawaJS - React
Build web apps with react js
Build web apps with react js
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
React Native for multi-platform mobile applications
React Native for multi-platform mobile applications
React & Redux for noobs
React & Redux for noobs
ReactJS.pptx
ReactJS.pptx
Kürzlich hochgeladen
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
2toLead Limited
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Curtis Poe
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
NavinnSomaal
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
DianaGray10
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Pixlogix Infotech
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Dubai Multi Commodity Centre
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
ScyllaDB
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Enterprise Knowledge
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Scott Keck-Warren
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
Manik S Magar
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Florian Wilhelm
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
charlottematthew16
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
Alfredo García Lavilla
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
UiPathCommunity
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
How to write a Business Continuity Plan
How to write a Business Continuity Plan
Databarracks
Kürzlich hochgeladen
(20)
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
How to write a Business Continuity Plan
How to write a Business Continuity Plan
A full introductory guide to React
1.
A full introductory guide
to React
2.
Jean Emer @jcemer jcemer.com
3.
4.
Work&Co Digital Products
5.
***
6.
1of9 What is React for
7.
React is a
library for building modular and reusable user interfaces
8.
It is good
for webapps that has different states and also to define a styleguide
9.
10.
State management is the
coordination of actions and its effects
11.
http://material-ui.com
12.
Styleguide is a good
way to keep your project in shape
13.
2of9 What is a
React component
14.
class HelloMessage extends
React.Component { render() { return ( <div> Hello {this.props.name} </div> ); } }
15.
JSX is XML
with JavaScript
16.
class HelloMessage extends
React.Component { render() { return React.createElement( "div", null, "Hello ", this.props.name ); } }
17.
class Timer extends
React.Component { constructor(props) { super(props); this.state = { seconds: 0 }; } tick() { this.setState(prevState => ({ seconds: prevState.seconds + 1 })); } componentDidMount() { this.interval = setInterval(() => this.tick(), 1000); } componentWillUnmount() { clearInterval(this.interval); } render() { return ( <div>Seconds: {this.state.seconds}</div> ); } } State management Life cycles HTML with states and props
18.
A React component is
props, states, and life cycle hooks together
19.
React is declarative, there
is no need to define the interface transitions
20.
<div>Seconds: {this.state.seconds}</div> I want
a <div> with the seconds inside. Do it!
21.
The role of
the Virtual DOM is to transform the render result in imperative DOM instructions
22.
<div>Seconds: 1</div> From <div>Seconds: 2</div> To element.textContent
= 'Seconds 2' Do
23.
24.
return ( <ReactCSSTransitionGroup transitionName='number' transitionEnterTimeout={200} transitionLeaveTimeout={200}> <div key={this.state.seconds}> Seconds:
{this.state.seconds} </div> </ReactCSSTransitionGroup> ); https://reactjs.org/docs/animation.html
25.
3of9 How to setup
and build React
26.
ReactDOM.render( <Component any={data} />, document .getElementById(‘component-root') ); It
renders a component in the document
27.
There is at
least the need of using Babel with Transform React JSX plugin
28.
https://github.com/ facebookincubator/create-react-app
29.
30.
31.
https://github.com/facebookincubator/create-react-app/blob/ master/packages/react-scripts/config/webpack.config.dev.js
32.
33.
4of9 How to fetch data
for a component
34.
class ServerTime extends
React.Component { constructor(props) { super(props); this.state = { time: 'Fetching' }; } componentDidMount() { axios.get('/time.json') .then(res => this.setState({ time: res.data.time })); } render() { return ( <div>{this.state.time}</div> ); } } Get a response and change the state
35.
Fetch the data right
before the component is mounted
36.
But what happens if
the component isn’t mounted anymore when the response arrives?
37.
class ServerTime extends
React.Component { constructor(props) { super(props); this.cancelToken = axios.CancelToken.source(); this.state = { time: 'Fetching' }; } componentDidMount() { axios.get('/time.json', { cancelToken: this.cancelToken.token }) .then(res => this.setState({ time: res.data.time })); } componentWillUnmount() { this.cancelToken.cancel('Operation canceled by the user.'); } render() { return ( <div>{this.state.time}</div> ); } } Cancel token
38.
https://discuss.reactjs.org/t/cancel-async-fetch-on-unmount/3272/2
39.
5of9 How to share state
between components
40.
class ServerTime extends
React.Component { constructor(props) { super(props); this.state = { time: 'Fetching' }; } componentDidMount() { /* Fetch server time */ } render() { return ( <div> <Header time={this.state.time} /> <Content time={this.state.time} /> <Footer time={this.state.time} /> </div> ); } } Send the time via prop to different components
41.
User
42.
User
43.
Transporting a user through
all the component tree is a boring job
44.
window.user = {
name: 'Jean' } All components can easily access the user But what happens if the user login or logout
45.
https://redux.js.org/
46.
The state store keeps
the user and can be connected to components
47.
import { connect
} from 'react-redux'; const mapStateToProps = state => ({ user: state.user }) export default connect(mapStateToProps)(Header); Maps the user to a prop
48.
Login and logout are
actions that change the state store
49.
store.dispatch(fetchUserAction); this.props.dispatch(logoutAction); On app bootstrap Inside
a connected component
50.
https://daveceddia.com/how-does-redux-work/
51.
6of9 What is children, HOC,
render prop, and more
52.
All that will
see are techniques to code reuse
53.
function Content(props) { return
( <div className='content'> {props.children} </div> ); } <Content> <Article /> <Comments /> </Content> Usage Content is a generic box
54.
Higher-Order Component is a function
that takes a component and returns a new component React documentation
55.
import { connect
} from 'react-redux'; const mapStateToProps = state => ({ user: state.user }) export default connect(mapStateToProps)(Header); It’s a HOC
56.
<UserProvider> {user => ( <Header
{...this.props} user={user}/> )} </UserProvider> Function as child component function UserProvider(props) { return props.children(window.user); }
57.
A render prop
is a function prop that a component uses to know what to render https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce
58.
<UserProvider render={user =>
( <Header {...this.props} user={user}/> )}/> Render is a prop that accepts a function to render
59.
• Children • Function
as Child Component • Higher-Order Component • Function (render) as Prop Component
60.
const HelloWorld =
() => (<div>Hello world</div>); React Stateless Functional Components
61.
7of9 A bit about performance
62.
React is fast!
63.
https://reactjs.org/docs/react-api.html#reactpurecomponent
64.
class HelloMessage extends
React.Component { render() { return ( <div> Hello {this.props.name} </div> ); } }
65.
class HelloMessage extends
React.PureComponent { render() { return ( <div> Hello {this.props.name} </div> ); } } Shallow compare
66.
shouldComponentUpdate()
67.
8of9 How to route an
application
68.
const BasicExample =
() => ( <Router> <div> <ul> <li><Link to="/">Home</Link></li> <li><Link to="/about">About</Link></li> <li><Link to="/topics">Topics</Link></li> </ul> <hr/> <Route exact path="/" component={Home}/> <Route path="/about" component={About}/> <Route path="/topics" component={Topics}/> </div> </Router> ) React Router code example
69.
It can be
very complex if you try to async load data and animate the transitions
70.
***
71.
9of9 How to run React
on the server
72.
ReactDOM.renderToString( <Component any={data} /> );
73.
React Router default routing
is dynamic and it is hard to fetch data on the server because of that
74.
https://crypt.codemancers.com/posts/2017-06-03-reactjs-server-side- rendering-with-router-v4-and-redux/
75.
https://crypt.codemancers.com/posts/2017-06-03-reactjs-server-side- rendering-with-router-v4-and-redux/
76.
https://zeit.co/blog/next
77.
https://zeit.co/blog/next
78.
***
79.
I hope it
inspires you @jcemer Thank you!
Jetzt herunterladen