Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Recriando o React do Zero em 10 minutos
Search
Afonso Pacifer
July 29, 2023
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Recriando o React do Zero em 10 minutos
Front in Sampa 2023
Afonso Pacifer
July 29, 2023
Transcript
28 slides
afonsopacifer.github.io Recriando o React do Zero em 10 minutos 1
afonsopacifer.github.io
Afonso Pacifer @afonsopacifer afonsopacifer.github.io DevRel & Front-End Specialist 2
Como usar o React? Sem create react app ou vite!
index.js import React . from “react" import ReactDom . from
“react-dom" Inst al l $ npm install react $ npm install react-dom
const Element = React.createElement( 'h1', { className: ‘sampa' }, 'Hello
World' ); Comp on ent HelloWorld.js ?
const Element = React.createElement( … } ReactDOM.render( Element, document.getElementById(‘app’) );
<div id=”app”><div/> Hello World index.js index.html Rend e
Por que usar?
Não toca no DOM
None
None
Duas funções
.component( ) JS const Element = component( 'h1', { id:
‘sampa' }, 'Hello' ); OBJ { type: 'h1', props: { id: ‘samba' }, children: [‘Hello'] }
.render( ) JS render( OBJ, document.getElementById(‘app’) ); <h1 id=”sampa”> Hello
<h1/> DOM API Hello
Exemplo
.map( )
Não toca no DOM?
OBJ { type: 'h1', props: {id: “app”}, children: [] }
New OBJ { type: ‘h2', props: {id: “app”}, children: [] } JS component( 'h1', { id: ‘sampa' }, 'Hello' ) JS render( OBJ, document.getElementById(‘app’) ); Diff <div id=”app”><div/>
Virtual DOM
Virtual DOM DOM
None
Developer Experience
None
const Element = ( <div> <h1>Hello, world!</h1> </div> ); const
HelloWorld = () => ( <div> <Element/> </div> ); HelloWorld.js JSX
… 24
fronti n .j s fronti n .j s github.com/afonsopacifer/frontinjs $
npm install frontinjs Functional and stateless component library
fronti n .j s fronti n .j s github.com/afonsopacifer/frontinjs
27 "Não se limite a ser apenas um(a) Dev React,
seja um(a) Dev Front-End” - Afonso Pacifer
@afonsopacifer Obrigado Front in Sampa afonsopacifer.github.io 28
More Decks by Afonso Pacifer
See All by Afonso Pacifer
Developer Experience (DevEx) no mundo Front-End: Do Ruby ao Next.js
afonsopacifer
0
130
Open Source e Developer Experience
afonsopacifer
1
180
Conhecendo a área de Developer Experience (DevEx)
afonsopacifer
0
150
Do Zero ao Sênior Apenas com Projetos Open Source
afonsopacifer
1
150
Guia para se tornar uma Pessoa Desenvolvedora Front-end Especialista
afonsopacifer
0
140
O CAMINHO PARA SE TORNAR UM(A) MESTRE(A) DOS ESTILOS COM CSS LV 5.
afonsopacifer
0
260
HTML 5.3: O que existe além de a11y e SEO?
afonsopacifer
0
240
State of JS 2022
afonsopacifer
0
370
Welcome CSS LV5
afonsopacifer
0
300
Other Decks in Programming
See All in Programming
あなたはMCPの機能を、まだ知らない。
4geru
1
500
AI-Powered Domain-Driven Design
ziobrando
0
460
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
350
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
380
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
140
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.3k
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
360
手の動かし方がわからなかった私が個人開発者になるまで
usagi0920_pochi
0
210
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
330
imagewebp()の向こう側: WebPはなぜ JPEG・PNGより軽いのか
yuzneri
0
120
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1k
Featured
See All Featured
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
530
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Cult of Friendly URLs
andyhume
79
7.1k
Scaling GitHub
holman
464
140k
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
810
The Mindset for Success: Future Career Progression
greggifford
PRO
0
560
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Practical Orchestrator
shlominoach
192
12k
The Language of Interfaces
destraynor
162
27k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
470