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
45
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
14
Open Source e Developer Experience
afonsopacifer
1
53
Conhecendo a área de Developer Experience (DevEx)
afonsopacifer
0
26
Do Zero ao Sênior Apenas com Projetos Open Source
afonsopacifer
1
33
Guia para se tornar uma Pessoa Desenvolvedora Front-end Especialista
afonsopacifer
0
36
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
110
State of JS 2022
afonsopacifer
0
230
Welcome CSS LV5
afonsopacifer
0
180
Other Decks in Programming
See All in Programming
たのしいparse.y
ydah
3
120
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
5
720
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
480
return文におけるstd::moveについて
onihusube
1
1.2k
Security_for_introducing_eBPF
kentatada
0
110
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
140
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
340
Exploring: Partial and Independent Composables
blackbracken
0
100
Go の GC の不得意な部分を克服したい
taiyow
3
800
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
480
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
A Philosophy of Restraint
colly
203
16k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
What's in a price? How to price your products and services
michaelherold
243
12k
Bash Introduction
62gerente
608
210k
GraphQLとの向き合い方2022年版
quramy
44
13k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
It's Worth the Effort
3n
183
28k
Building Applications with DynamoDB
mza
91
6.1k
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