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
iOSエンジニアから始める visionOS アプリ開発
nao_randd
3
120
Honoとフロントエンドの 型安全性について
yodaka
4
250
時計仕掛けのCompose
mkeeda
1
280
Ruby on cygwin 2025-02
fd0
0
140
Software Architecture
hschwentner
6
2.1k
Spring gRPC について / About Spring gRPC
mackey0225
0
220
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
CloudNativePGがCNCF Sandboxプロジェクトになったぞ! 〜CloudNativePGの仕組みの紹介〜
nnaka2992
0
220
CNCF Project の作者が考えている OSS の運営
utam0k
5
690
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
200
Amazon Bedrock Multi Agentsを試してきた
tm2
1
280
『品質』という言葉が嫌いな理由
korimu
0
160
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.6k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
How STYLIGHT went responsive
nonsquared
98
5.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
400
Speed Design
sergeychernyshev
25
780
Music & Morning Musume
bryan
46
6.3k
Agile that works and the tools we love
rasmusluckow
328
21k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
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