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
100
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
75
Open Source e Developer Experience
afonsopacifer
1
120
Conhecendo a área de Developer Experience (DevEx)
afonsopacifer
0
98
Do Zero ao Sênior Apenas com Projetos Open Source
afonsopacifer
1
97
Guia para se tornar uma Pessoa Desenvolvedora Front-end Especialista
afonsopacifer
0
92
O CAMINHO PARA SE TORNAR UM(A) MESTRE(A) DOS ESTILOS COM CSS LV 5.
afonsopacifer
0
200
HTML 5.3: O que existe além de a11y e SEO?
afonsopacifer
0
190
State of JS 2022
afonsopacifer
0
310
Welcome CSS LV5
afonsopacifer
0
240
Other Decks in Programming
See All in Programming
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
SourceGeneratorのススメ
htkym
0
200
CSC307 Lecture 09
javiergs
PRO
1
840
CSC307 Lecture 06
javiergs
PRO
0
690
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
組織で育むオブザーバビリティ
ryota_hnk
0
180
Grafana:建立系統全知視角的捷徑
blueswen
0
330
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
並行開発のためのコードレビュー
miyukiw
0
280
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
740
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
370
Featured
See All Featured
The browser strikes back
jonoalderson
0
390
The SEO Collaboration Effect
kristinabergwall1
0
350
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
55
Believing is Seeing
oripsolob
1
56
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
Skip the Path - Find Your Career Trail
mkilby
0
57
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
62
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
97
Building AI with AI
inesmontani
PRO
1
700
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
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