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
0
56
Recriando o React do Zero em 10 minutos
Front in Sampa 2023
Afonso Pacifer
July 29, 2023
Tweet
Share
More Decks by Afonso Pacifer
See All by Afonso Pacifer
Developer Experience (DevEx) no mundo Front-End: Do Ruby ao Next.js
afonsopacifer
0
28
Open Source e Developer Experience
afonsopacifer
1
59
Conhecendo a área de Developer Experience (DevEx)
afonsopacifer
0
39
Do Zero ao Sênior Apenas com Projetos Open Source
afonsopacifer
1
47
Guia para se tornar uma Pessoa Desenvolvedora Front-end Especialista
afonsopacifer
0
45
O CAMINHO PARA SE TORNAR UM(A) MESTRE(A) DOS ESTILOS COM CSS LV 5.
afonsopacifer
0
150
HTML 5.3: O que existe além de a11y e SEO?
afonsopacifer
0
130
State of JS 2022
afonsopacifer
0
250
Welcome CSS LV5
afonsopacifer
0
190
Other Decks in Programming
See All in Programming
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
29
11k
TokyoR116_BeginnersSession1_環境構築
kotatyamtema
0
110
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
480
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
150
プログラミング言語学習のススメ / why-do-i-learn-programming-language
yashi8484
0
120
テストをしないQAエンジニアは何をしているか?
nealle
0
130
SpringBoot3.4の構造化ログ #kanjava
irof
2
970
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
670
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
5.1k
Bedrock Agentsレスポンス解析によるAgentのOps
licux
2
720
ARA Ansible for the teams
kksat
0
150
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
200
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Fireside Chat
paigeccino
34
3.2k
How to train your dragon (web standard)
notwaldorf
90
5.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
A Philosophy of Restraint
colly
203
16k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Designing Experiences People Love
moore
139
23k
How to Ace a Technical Interview
jacobian
276
23k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
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