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
44
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
10
Open Source e Developer Experience
afonsopacifer
1
51
Conhecendo a área de Developer Experience (DevEx)
afonsopacifer
0
24
Do Zero ao Sênior Apenas com Projetos Open Source
afonsopacifer
1
31
Guia para se tornar uma Pessoa Desenvolvedora Front-end Especialista
afonsopacifer
0
33
O CAMINHO PARA SE TORNAR UM(A) MESTRE(A) DOS ESTILOS COM CSS LV 5.
afonsopacifer
0
130
HTML 5.3: O que existe além de a11y e SEO?
afonsopacifer
0
100
State of JS 2022
afonsopacifer
0
230
Welcome CSS LV5
afonsopacifer
0
180
Other Decks in Programming
See All in Programming
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
740
Develop iOS apps with Neovim / vimconf_2024
uhooi
1
340
DevTools extensions で 独自の DevTool を開発する | FlutterKaigi 2024
kokiyoshida
0
460
Thoughts and experiences on Rust and TypeScript
unvalley
2
220
Refactor your code - refactor yourself
xosofox
1
200
Cursorでアプリケーションの追加開発や保守をどこまでできるか試したら得るものが多かった話
drumnistnakano
0
290
Cognitoが大型アップデート!Managed Loginとパスワードレスログインを実際に使ってみた@しむそくRadio Special Day1
tmhirai
3
280
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
150
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
220
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
660
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
150
PipeCDの歩き方
kuro_kurorrr
4
140
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Navigating Team Friction
lara
183
15k
Building Adaptive Systems
keathley
38
2.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
73
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
260
A designer walks into a library…
pauljervisheath
204
24k
Bash Introduction
62gerente
608
210k
The World Runs on Bad Software
bkeepers
PRO
65
11k
KATA
mclloyd
29
14k
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