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
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
110
Open Source e Developer Experience
afonsopacifer
1
150
Conhecendo a área de Developer Experience (DevEx)
afonsopacifer
0
130
Do Zero ao Sênior Apenas com Projetos Open Source
afonsopacifer
1
130
Guia para se tornar uma Pessoa Desenvolvedora Front-end Especialista
afonsopacifer
0
120
O CAMINHO PARA SE TORNAR UM(A) MESTRE(A) DOS ESTILOS COM CSS LV 5.
afonsopacifer
0
230
HTML 5.3: O que existe além de a11y e SEO?
afonsopacifer
0
220
State of JS 2022
afonsopacifer
0
340
Welcome CSS LV5
afonsopacifer
0
270
Other Decks in Programming
See All in Programming
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
1.5k
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
140
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
130
どこまでゆるくて許されるのか
tk3fftk
0
500
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.5k
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
510
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
120
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
110
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
180
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
Performance Engineering for Everyone
elenatanasoiu
0
270
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
380
Testing 201, or: Great Expectations
jmmastey
46
8.2k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Deep Space Network (abreviated)
tonyrice
0
230
Mobile First: as difficult as doing things right
swwweet
225
10k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Raft: Consensus for Rubyists
vanstee
141
7.6k
Evolving SEO for Evolving Search Engines
ryanjones
0
240
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.4k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
420
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
470
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