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
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
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
260
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
580
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
130
Coding as Prompting Since 2025
ragingwind
0
600
Feature Toggle は捨てやすく使おう
gennei
0
390
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
100
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1.2k
AI活用のコスパを最大化する方法
ochtum
0
360
へんな働き方
yusukebe
6
2.9k
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
110
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
900
20260320登壇資料
pharct
0
140
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
800
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Building Adaptive Systems
keathley
44
3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
80
Test your architecture with Archunit
thirion
1
2.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
270
A Soul's Torment
seathinner
5
2.6k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
Technical Leadership for Architectural Decision Making
baasie
3
300
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