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
110
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
85
Open Source e Developer Experience
afonsopacifer
1
140
Conhecendo a área de Developer Experience (DevEx)
afonsopacifer
0
110
Do Zero ao Sênior Apenas com Projetos Open Source
afonsopacifer
1
110
Guia para se tornar uma Pessoa Desenvolvedora Front-end Especialista
afonsopacifer
0
100
O CAMINHO PARA SE TORNAR UM(A) MESTRE(A) DOS ESTILOS COM CSS LV 5.
afonsopacifer
0
210
HTML 5.3: O que existe além de a11y e SEO?
afonsopacifer
0
200
State of JS 2022
afonsopacifer
0
320
Welcome CSS LV5
afonsopacifer
0
250
Other Decks in Programming
See All in Programming
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
120
安いハードウェアでVulkan
fadis
1
870
Feature Toggle は捨てやすく使おう
gennei
0
400
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
290
AIと共にエンジニアとPMの “二刀流”を実現する
naruogram
0
120
OTP を自動で入力する裏技
megabitsenmzq
0
130
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
1
230
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
190
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
170
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
110
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
820
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.4k
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
840
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
120
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Optimizing for Happiness
mojombo
378
71k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Thoughts on Productivity
jonyablonski
76
5.1k
The SEO Collaboration Effect
kristinabergwall1
0
410
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
It's Worth the Effort
3n
188
29k
A Modern Web Designer's Workflow
chriscoyier
698
190k
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