Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Recriando o React do Zero em 10 minutos
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Afonso Pacifer
July 29, 2023
Programming
120
0
Share
Recriando o React do Zero em 10 minutos
Front in Sampa 2023
Afonso Pacifer
July 29, 2023
More Decks by Afonso Pacifer
See All by Afonso Pacifer
Developer Experience (DevEx) no mundo Front-End: Do Ruby ao Next.js
afonsopacifer
0
97
Open Source e Developer Experience
afonsopacifer
1
140
Conhecendo a área de Developer Experience (DevEx)
afonsopacifer
0
120
Do Zero ao Sênior Apenas com Projetos Open Source
afonsopacifer
1
120
Guia para se tornar uma Pessoa Desenvolvedora Front-end Especialista
afonsopacifer
0
110
O CAMINHO PARA SE TORNAR UM(A) MESTRE(A) DOS ESTILOS COM CSS LV 5.
afonsopacifer
0
220
HTML 5.3: O que existe além de a11y e SEO?
afonsopacifer
0
210
State of JS 2022
afonsopacifer
0
330
Welcome CSS LV5
afonsopacifer
0
270
Other Decks in Programming
See All in Programming
3Dシーンの圧縮
fadis
1
520
Claspは野良GASの夢をみるか
takter00
0
140
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.3k
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
7
1.3k
Inside Stream API
skrb
1
400
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
420
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
470
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
RTSPクライアントを自作してみた話
simotin13
0
370
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
420
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
350
Visualization
eitanlees
152
17k
Docker and Python
trallard
47
3.9k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
AI: The stuff that nobody shows you
jnunemaker
PRO
7
670
Six Lessons from altMBA
skipperchong
29
4.3k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
810
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
150
4 Signs Your Business is Dying
shpigford
187
22k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
180
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
Transcript
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