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
Afonso Pacifer
July 29, 2023
Programming
130
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
99
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
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
330
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.5k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.5k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
410
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
3.3k
Lessons from Spec-Driven Development
simas
PRO
0
120
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
160
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
110
net-httpのHTTP/2対応について
naruse
0
420
AIとRubyの静的型付け
ukin0k0
0
510
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
310
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.3k
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
230
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
380
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
590
Deep Space Network (abreviated)
tonyrice
0
160
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
260
Utilizing Notion as your number one productivity tool
mfonobong
4
310
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
320
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Leo the Paperboy
mayatellez
7
1.8k
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