SlideShare a Scribd company logo
1 of 24
Download to read offline
•
•
•
•
•
•
•
import React from 'react';
import ReactDOM from 'react-dom';
class Hello extends React.Component {
render() {
return React.createElement('div', null, 'Hello world!');
}
}
ReactDOM.render(
React.createElement(Hello),
document.getElementById('root')
);
React.createElement('a', { href: 'https://goo.gl/zRPems' }, "lorem ipsum");
<a href={'https://goo.gl/zRPems'}>{'lorem ipsum'}</a>
import React from 'react';
import ReactDOM from 'react-dom';
class Hello extends React.Component {
render() {
return <div>{'Hello world!'}</div>;
}
}
ReactDOM.render(
<Hello />,
document.getElementById('root')
);
•
•
•
•
class Hello extends React.Component {
render() {
const whatToGreeting = this.props.whatToGreeting;
return <div>{`Hello ${whatToGreeting}!`}</div>;
}
}
ReactDOM.render(
<Hello whatToGreeting="world" />,
document.getElementById('root')
);
import PropTypes from 'prop-types';
class Hello extends React.Component {
static propTypes = {
whatToGreeting: PropTypes.string.isRequired,
}
render() {
const whatToGreeting = this.props.whatToGreeting;
return <div>{`Hello ${whatToGreeting}!`}</div>;
}
}
import PropTypes from 'prop-types';
class Hello extends React.Component {
render() {
const whatToGreeting = this.props.whatToGreeting;
return <div>{`Hello ${whatToGreeting}!`}</div>;
}
}
Hello.propTypes = {
whatToGreeting: PropTypes.string.isRequired,
};
•
•
•
class MyButton extends React.Component {
constructor() {
super();
this.state = {
label: 'Click me',
};
}
render() {
return <button>{this.state.label}</button>;
}
}
class MyButton extends React.Component {
constructor() {
super();
this.state = {
label: 'Click me',
};
}
handleClick = () => {
this.setState({
label: 'Clicked',
});
}
render() {
return <button onClick={this.handleClick}>{this.state.label}</button>;
}
}
const buttonStyle = {
borderRadius: 5,
padding: '15px',
backgroundColor: 'yellow',
};
class MyButton extends React.Component {
render() {
return <button style={buttonStyle}>{'I am a fantastic button'}</button>;
}
}
import './buttonStyle.css';
class MyButton extends React.Component {
render() {
return (
<button className={'yellow-button'}>
{'I am a fantastic button with a fantastic class'}
</button>
);
}
}
import styled from 'styled-component';
const StyledButton = styled.button`
border-radius: 5px;
padding: 15px;
background-color: yellow;
`;
class MyButton extends React.Component {
render() {
return <StyledButton>{'I am a styled component now!!'}</StyledButton>;
}
}
"How to... React" by Luca Perna
"How to... React" by Luca Perna

More Related Content

What's hot

Neoito — React 101
Neoito — React 101Neoito — React 101
Neoito — React 101Neoito
 
Switch to React.js from AngularJS developer
Switch to React.js from AngularJS developerSwitch to React.js from AngularJS developer
Switch to React.js from AngularJS developerEugene Zharkov
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJSPeter Drinnan
 
AngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and JasmineAngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and Jasminefoxp2code
 
Better web apps with React and Redux
Better web apps with React and ReduxBetter web apps with React and Redux
Better web apps with React and ReduxAli Sa'o
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit TestChiew Carol
 
Intro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJSIntro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJSJim Lynch
 
Intro to Redux | DreamLab Academy #3
Intro to Redux | DreamLab Academy #3 Intro to Redux | DreamLab Academy #3
Intro to Redux | DreamLab Academy #3 DreamLab
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingBinary Studio
 
Test-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS ApplicationsTest-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS ApplicationsFITC
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmineTimothy Oxley
 
Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with Reactpeychevi
 
Designing applications with Redux
Designing applications with ReduxDesigning applications with Redux
Designing applications with ReduxFernando Daciuk
 
Dive into React Performance
Dive into React PerformanceDive into React Performance
Dive into React PerformanceChing Ting Wu
 
React Lifecycle and Reconciliation
React Lifecycle and ReconciliationReact Lifecycle and Reconciliation
React Lifecycle and ReconciliationZhihao Li
 

What's hot (20)

Redux Universal
Redux UniversalRedux Universal
Redux Universal
 
Neoito — React 101
Neoito — React 101Neoito — React 101
Neoito — React 101
 
React on es6+
React on es6+React on es6+
React on es6+
 
Using redux
Using reduxUsing redux
Using redux
 
Switch to React.js from AngularJS developer
Switch to React.js from AngularJS developerSwitch to React.js from AngularJS developer
Switch to React.js from AngularJS developer
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJS
 
React redux
React reduxReact redux
React redux
 
AngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and JasmineAngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and Jasmine
 
Better web apps with React and Redux
Better web apps with React and ReduxBetter web apps with React and Redux
Better web apps with React and Redux
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
 
Intro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJSIntro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJS
 
Intro to Redux | DreamLab Academy #3
Intro to Redux | DreamLab Academy #3 Intro to Redux | DreamLab Academy #3
Intro to Redux | DreamLab Academy #3
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & Tooling
 
Pragmatic React Workshop
Pragmatic React WorkshopPragmatic React Workshop
Pragmatic React Workshop
 
Test-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS ApplicationsTest-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS Applications
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
 
Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with React
 
Designing applications with Redux
Designing applications with ReduxDesigning applications with Redux
Designing applications with Redux
 
Dive into React Performance
Dive into React PerformanceDive into React Performance
Dive into React Performance
 
React Lifecycle and Reconciliation
React Lifecycle and ReconciliationReact Lifecycle and Reconciliation
React Lifecycle and Reconciliation
 

Similar to "How to... React" by Luca Perna

Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16Benny Neugebauer
 
React js t4 - components
React js   t4 - componentsReact js   t4 - components
React js t4 - componentsJainul Musani
 
React Native Androidはなぜ動くのか
React Native Androidはなぜ動くのかReact Native Androidはなぜ動くのか
React Native Androidはなぜ動くのかYukiya Nakagawa
 
React js t8 - inlinecss
React js   t8 - inlinecssReact js   t8 - inlinecss
React js t8 - inlinecssJainul Musani
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab AcademyDreamLab
 
Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Elyse Kolker Gordon
 
React Native & NativeScript
React Native & NativeScriptReact Native & NativeScript
React Native & NativeScriptElifTech
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeRyan Boland
 
2018 05-16 Evolving Technologies: React, Babel & Webpack
2018 05-16 Evolving Technologies: React, Babel & Webpack2018 05-16 Evolving Technologies: React, Babel & Webpack
2018 05-16 Evolving Technologies: React, Babel & WebpackCodifly
 
Apollo. The client we deserve
Apollo. The client we deserveApollo. The client we deserve
Apollo. The client we deserveYuri Nezdemkovski
 
Vue JS @ MindDoc. The progressive road to online therapy
Vue JS @ MindDoc. The progressive road to online therapyVue JS @ MindDoc. The progressive road to online therapy
Vue JS @ MindDoc. The progressive road to online therapyDarío Blanco Iturriaga
 
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...Applitools
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_jsMicroPyramid .
 
React Nativeの光と闇
React Nativeの光と闇React Nativeの光と闇
React Nativeの光と闇Yukiya Nakagawa
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs[T]echdencias
 
Pragmatic introduction to react
Pragmatic introduction to reactPragmatic introduction to react
Pragmatic introduction to reactMaayan Glikser
 

Similar to "How to... React" by Luca Perna (20)

Intro to ReactJS
Intro to ReactJSIntro to ReactJS
Intro to ReactJS
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16
 
React js t4 - components
React js   t4 - componentsReact js   t4 - components
React js t4 - components
 
React native by example by Vadim Ruban
React native by example by Vadim RubanReact native by example by Vadim Ruban
React native by example by Vadim Ruban
 
React Native Androidはなぜ動くのか
React Native Androidはなぜ動くのかReact Native Androidはなぜ動くのか
React Native Androidはなぜ動くのか
 
React js
React jsReact js
React js
 
React js t8 - inlinecss
React js   t8 - inlinecssReact js   t8 - inlinecss
React js t8 - inlinecss
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab Academy
 
React outbox
React outboxReact outbox
React outbox
 
Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017
 
React Native & NativeScript
React Native & NativeScriptReact Native & NativeScript
React Native & NativeScript
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
 
2018 05-16 Evolving Technologies: React, Babel & Webpack
2018 05-16 Evolving Technologies: React, Babel & Webpack2018 05-16 Evolving Technologies: React, Babel & Webpack
2018 05-16 Evolving Technologies: React, Babel & Webpack
 
Apollo. The client we deserve
Apollo. The client we deserveApollo. The client we deserve
Apollo. The client we deserve
 
Vue JS @ MindDoc. The progressive road to online therapy
Vue JS @ MindDoc. The progressive road to online therapyVue JS @ MindDoc. The progressive road to online therapy
Vue JS @ MindDoc. The progressive road to online therapy
 
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
React Nativeの光と闇
React Nativeの光と闇React Nativeの光と闇
React Nativeの光と闇
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs
 
Pragmatic introduction to react
Pragmatic introduction to reactPragmatic introduction to react
Pragmatic introduction to react
 

More from ThinkOpen

Discover Facilitation: gestire le riunioni in modo efficace
Discover Facilitation: gestire le riunioni in modo efficaceDiscover Facilitation: gestire le riunioni in modo efficace
Discover Facilitation: gestire le riunioni in modo efficaceThinkOpen
 
Infrastructure as a code: a cloud approach
Infrastructure as a code: a cloud approachInfrastructure as a code: a cloud approach
Infrastructure as a code: a cloud approachThinkOpen
 
Smart Signage: la nuova digital experience
Smart Signage: la nuova digital experienceSmart Signage: la nuova digital experience
Smart Signage: la nuova digital experienceThinkOpen
 
I Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utentiI Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utentiThinkOpen
 
2019: Odissea nell'e-commerce
2019: Odissea nell'e-commerce2019: Odissea nell'e-commerce
2019: Odissea nell'e-commerceThinkOpen
 
Guida galattica a Javascript
Guida galattica a JavascriptGuida galattica a Javascript
Guida galattica a JavascriptThinkOpen
 
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzioneJava 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzioneThinkOpen
 
Amazon Alexa vs Google Home. Quale scegliere? Funzionalità e usi
Amazon Alexa vs Google Home. Quale scegliere? Funzionalità e usiAmazon Alexa vs Google Home. Quale scegliere? Funzionalità e usi
Amazon Alexa vs Google Home. Quale scegliere? Funzionalità e usiThinkOpen
 
Amazon Web Services - Le potenzialità di AWS e il mondo di Amazon Alexa by Ni...
Amazon Web Services - Le potenzialità di AWS e il mondo di Amazon Alexa by Ni...Amazon Web Services - Le potenzialità di AWS e il mondo di Amazon Alexa by Ni...
Amazon Web Services - Le potenzialità di AWS e il mondo di Amazon Alexa by Ni...ThinkOpen
 
Polymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiPolymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiThinkOpen
 
"Java 8, Lambda e la programmazione funzionale" by Theodor Dumitrescu
"Java 8, Lambda e la programmazione funzionale" by Theodor Dumitrescu"Java 8, Lambda e la programmazione funzionale" by Theodor Dumitrescu
"Java 8, Lambda e la programmazione funzionale" by Theodor DumitrescuThinkOpen
 
"Odoo: l'open source che fa tremare SAP" by Davide Davin e Nicola Napolitano
"Odoo: l'open source che fa tremare SAP" by Davide Davin e Nicola Napolitano"Odoo: l'open source che fa tremare SAP" by Davide Davin e Nicola Napolitano
"Odoo: l'open source che fa tremare SAP" by Davide Davin e Nicola NapolitanoThinkOpen
 
"Configuration Manager: il ruolo nel ciclo di vita del software" by Omar Rossini
"Configuration Manager: il ruolo nel ciclo di vita del software" by Omar Rossini"Configuration Manager: il ruolo nel ciclo di vita del software" by Omar Rossini
"Configuration Manager: il ruolo nel ciclo di vita del software" by Omar RossiniThinkOpen
 
"Google Home: how to make Google do it" by Theodor Dumitrescu e Gianfranco Bo...
"Google Home: how to make Google do it" by Theodor Dumitrescu e Gianfranco Bo..."Google Home: how to make Google do it" by Theodor Dumitrescu e Gianfranco Bo...
"Google Home: how to make Google do it" by Theodor Dumitrescu e Gianfranco Bo...ThinkOpen
 
"ThinkOpen Agile Days - #Day3" by Donato Andrisani e Giuseppe Trotta
"ThinkOpen Agile Days - #Day3" by Donato Andrisani e Giuseppe Trotta"ThinkOpen Agile Days - #Day3" by Donato Andrisani e Giuseppe Trotta
"ThinkOpen Agile Days - #Day3" by Donato Andrisani e Giuseppe TrottaThinkOpen
 
"Reactive programming" by Theodor Dumitrescu & Gianfranco Bottiglieri
"Reactive programming" by Theodor Dumitrescu & Gianfranco Bottiglieri"Reactive programming" by Theodor Dumitrescu & Gianfranco Bottiglieri
"Reactive programming" by Theodor Dumitrescu & Gianfranco BottiglieriThinkOpen
 
"GDPR: cos'è e come funziona" by Francesco Puglisi
"GDPR: cos'è e come funziona" by Francesco Puglisi"GDPR: cos'è e come funziona" by Francesco Puglisi
"GDPR: cos'è e come funziona" by Francesco PuglisiThinkOpen
 
"ThinkOpen Agile Days - #Day2" by Donato Andrisani e Giuseppe Trotta
"ThinkOpen Agile Days - #Day2" by Donato Andrisani e Giuseppe Trotta"ThinkOpen Agile Days - #Day2" by Donato Andrisani e Giuseppe Trotta
"ThinkOpen Agile Days - #Day2" by Donato Andrisani e Giuseppe TrottaThinkOpen
 
"ThinkOpen Agile Days - #Day" by Giuseppe Trotta
"ThinkOpen Agile Days - #Day" by Giuseppe Trotta"ThinkOpen Agile Days - #Day" by Giuseppe Trotta
"ThinkOpen Agile Days - #Day" by Giuseppe TrottaThinkOpen
 
"React Native" by Vanessa Leo e Roberto Brogi
"React Native" by Vanessa Leo e Roberto Brogi "React Native" by Vanessa Leo e Roberto Brogi
"React Native" by Vanessa Leo e Roberto Brogi ThinkOpen
 

More from ThinkOpen (20)

Discover Facilitation: gestire le riunioni in modo efficace
Discover Facilitation: gestire le riunioni in modo efficaceDiscover Facilitation: gestire le riunioni in modo efficace
Discover Facilitation: gestire le riunioni in modo efficace
 
Infrastructure as a code: a cloud approach
Infrastructure as a code: a cloud approachInfrastructure as a code: a cloud approach
Infrastructure as a code: a cloud approach
 
Smart Signage: la nuova digital experience
Smart Signage: la nuova digital experienceSmart Signage: la nuova digital experience
Smart Signage: la nuova digital experience
 
I Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utentiI Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utenti
 
2019: Odissea nell'e-commerce
2019: Odissea nell'e-commerce2019: Odissea nell'e-commerce
2019: Odissea nell'e-commerce
 
Guida galattica a Javascript
Guida galattica a JavascriptGuida galattica a Javascript
Guida galattica a Javascript
 
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzioneJava 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
 
Amazon Alexa vs Google Home. Quale scegliere? Funzionalità e usi
Amazon Alexa vs Google Home. Quale scegliere? Funzionalità e usiAmazon Alexa vs Google Home. Quale scegliere? Funzionalità e usi
Amazon Alexa vs Google Home. Quale scegliere? Funzionalità e usi
 
Amazon Web Services - Le potenzialità di AWS e il mondo di Amazon Alexa by Ni...
Amazon Web Services - Le potenzialità di AWS e il mondo di Amazon Alexa by Ni...Amazon Web Services - Le potenzialità di AWS e il mondo di Amazon Alexa by Ni...
Amazon Web Services - Le potenzialità di AWS e il mondo di Amazon Alexa by Ni...
 
Polymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiPolymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele Gallotti
 
"Java 8, Lambda e la programmazione funzionale" by Theodor Dumitrescu
"Java 8, Lambda e la programmazione funzionale" by Theodor Dumitrescu"Java 8, Lambda e la programmazione funzionale" by Theodor Dumitrescu
"Java 8, Lambda e la programmazione funzionale" by Theodor Dumitrescu
 
"Odoo: l'open source che fa tremare SAP" by Davide Davin e Nicola Napolitano
"Odoo: l'open source che fa tremare SAP" by Davide Davin e Nicola Napolitano"Odoo: l'open source che fa tremare SAP" by Davide Davin e Nicola Napolitano
"Odoo: l'open source che fa tremare SAP" by Davide Davin e Nicola Napolitano
 
"Configuration Manager: il ruolo nel ciclo di vita del software" by Omar Rossini
"Configuration Manager: il ruolo nel ciclo di vita del software" by Omar Rossini"Configuration Manager: il ruolo nel ciclo di vita del software" by Omar Rossini
"Configuration Manager: il ruolo nel ciclo di vita del software" by Omar Rossini
 
"Google Home: how to make Google do it" by Theodor Dumitrescu e Gianfranco Bo...
"Google Home: how to make Google do it" by Theodor Dumitrescu e Gianfranco Bo..."Google Home: how to make Google do it" by Theodor Dumitrescu e Gianfranco Bo...
"Google Home: how to make Google do it" by Theodor Dumitrescu e Gianfranco Bo...
 
"ThinkOpen Agile Days - #Day3" by Donato Andrisani e Giuseppe Trotta
"ThinkOpen Agile Days - #Day3" by Donato Andrisani e Giuseppe Trotta"ThinkOpen Agile Days - #Day3" by Donato Andrisani e Giuseppe Trotta
"ThinkOpen Agile Days - #Day3" by Donato Andrisani e Giuseppe Trotta
 
"Reactive programming" by Theodor Dumitrescu & Gianfranco Bottiglieri
"Reactive programming" by Theodor Dumitrescu & Gianfranco Bottiglieri"Reactive programming" by Theodor Dumitrescu & Gianfranco Bottiglieri
"Reactive programming" by Theodor Dumitrescu & Gianfranco Bottiglieri
 
"GDPR: cos'è e come funziona" by Francesco Puglisi
"GDPR: cos'è e come funziona" by Francesco Puglisi"GDPR: cos'è e come funziona" by Francesco Puglisi
"GDPR: cos'è e come funziona" by Francesco Puglisi
 
"ThinkOpen Agile Days - #Day2" by Donato Andrisani e Giuseppe Trotta
"ThinkOpen Agile Days - #Day2" by Donato Andrisani e Giuseppe Trotta"ThinkOpen Agile Days - #Day2" by Donato Andrisani e Giuseppe Trotta
"ThinkOpen Agile Days - #Day2" by Donato Andrisani e Giuseppe Trotta
 
"ThinkOpen Agile Days - #Day" by Giuseppe Trotta
"ThinkOpen Agile Days - #Day" by Giuseppe Trotta"ThinkOpen Agile Days - #Day" by Giuseppe Trotta
"ThinkOpen Agile Days - #Day" by Giuseppe Trotta
 
"React Native" by Vanessa Leo e Roberto Brogi
"React Native" by Vanessa Leo e Roberto Brogi "React Native" by Vanessa Leo e Roberto Brogi
"React Native" by Vanessa Leo e Roberto Brogi
 

Recently uploaded

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

"How to... React" by Luca Perna

  • 1.
  • 2.
  • 5.
  • 7.
  • 8. import React from 'react'; import ReactDOM from 'react-dom'; class Hello extends React.Component { render() { return React.createElement('div', null, 'Hello world!'); } } ReactDOM.render( React.createElement(Hello), document.getElementById('root') );
  • 9. React.createElement('a', { href: 'https://goo.gl/zRPems' }, "lorem ipsum"); <a href={'https://goo.gl/zRPems'}>{'lorem ipsum'}</a>
  • 10. import React from 'react'; import ReactDOM from 'react-dom'; class Hello extends React.Component { render() { return <div>{'Hello world!'}</div>; } } ReactDOM.render( <Hello />, document.getElementById('root') );
  • 12. class Hello extends React.Component { render() { const whatToGreeting = this.props.whatToGreeting; return <div>{`Hello ${whatToGreeting}!`}</div>; } } ReactDOM.render( <Hello whatToGreeting="world" />, document.getElementById('root') );
  • 13.
  • 14. import PropTypes from 'prop-types'; class Hello extends React.Component { static propTypes = { whatToGreeting: PropTypes.string.isRequired, } render() { const whatToGreeting = this.props.whatToGreeting; return <div>{`Hello ${whatToGreeting}!`}</div>; } }
  • 15. import PropTypes from 'prop-types'; class Hello extends React.Component { render() { const whatToGreeting = this.props.whatToGreeting; return <div>{`Hello ${whatToGreeting}!`}</div>; } } Hello.propTypes = { whatToGreeting: PropTypes.string.isRequired, };
  • 17. class MyButton extends React.Component { constructor() { super(); this.state = { label: 'Click me', }; } render() { return <button>{this.state.label}</button>; } }
  • 18. class MyButton extends React.Component { constructor() { super(); this.state = { label: 'Click me', }; } handleClick = () => { this.setState({ label: 'Clicked', }); } render() { return <button onClick={this.handleClick}>{this.state.label}</button>; } }
  • 19.
  • 20. const buttonStyle = { borderRadius: 5, padding: '15px', backgroundColor: 'yellow', }; class MyButton extends React.Component { render() { return <button style={buttonStyle}>{'I am a fantastic button'}</button>; } }
  • 21. import './buttonStyle.css'; class MyButton extends React.Component { render() { return ( <button className={'yellow-button'}> {'I am a fantastic button with a fantastic class'} </button> ); } }
  • 22. import styled from 'styled-component'; const StyledButton = styled.button` border-radius: 5px; padding: 15px; background-color: yellow; `; class MyButton extends React.Component { render() { return <StyledButton>{'I am a styled component now!!'}</StyledButton>; } }