Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ReactJS Starter
Search
Gefy Marcos
November 22, 2022
Programming
0
34
ReactJS Starter
Palestra realizada durante o november tech, no Senac, Tubarão - SC em 11/2022.
Gefy Marcos
November 22, 2022
Tweet
Share
More Decks by Gefy Marcos
See All by Gefy Marcos
Desbravando a Carreira em Desenvolvimento: Dicas e Estratégias para iniciantes
gefymarcos
0
30
Zod: Levando a validação de dados a um novo nível.
gefymarcos
0
1.5k
Clean Code: Boas práticas e design de código
gefymarcos
0
160
Web to PWA!
gefymarcos
0
72
React Native por onde começar
gefymarcos
0
150
Other Decks in Programming
See All in Programming
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
ゲームの物理 剛体編
fadis
0
340
認証・認可の基本を学ぼう前編
kouyuume
0
200
関数実行の裏側では何が起きているのか?
minop1205
1
690
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
830
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
660
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
160
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
160
AWS CDKの推しポイントN選
akihisaikeda
1
240
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
320
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Typedesign – Prime Four
hannesfritz
42
2.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Side Projects
sachag
455
43k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
GraphQLとの向き合い方2022年版
quramy
50
14k
BBQ
matthewcrist
89
9.9k
Raft: Consensus for Rubyists
vanstee
141
7.2k
Transcript
REACTJS STARTER
Founder @code4tuba GEFY GEFFERSON MARCOS Tech Lead Frontend @ StudioSol
None
O QUE É REACT? UMA BIBLIOTECA JAVASCRIPT PARA CRIAR INTERFACES
DE USUÁRIO
Facilita a criação de UIs; Deixa o código mais previsível
e simples de depurar. DECLARATIVO
Permite criar componentes encapsulados que gerenciam seu próprio estado; Permite
deixar a lógica da aplicação fora do DOM. BASEADO EM COMPONENTES
Funciona na Web, no backend com Node e para aplicativos
com React-Native. USE EM QUALQUER LUGAR
TEM MERCADO?
QUEM USA?
HELLO WORLD
ISSO É REACT class HelloWorld extends React.Component { render() {
return <div>Hello World </ div>; } } root.render(<HelloWorld /> );
É uma extensão de sintaxe para javascript; Recomendado para escrever
a UI; JSX
No React a lógica de renderização é acoplada as outras
lógicas de UI; Manipulação de eventos; Mudança de estado; Preparação de dados pra exibição. POR QUE JSX?
EU SOU UM ARQUIVO JSX const element = <h1>Hello, world!</h1>;
O DOM é a representação de dados de uma página
web; O React criou o React DOM pra fazer a manipulação desse DOM de forma performática. RENDERIZAÇÃO DE ELEMENTOS
O React DOM compara o elemento novo e seus f
ilhos e aplica a alteração só no nó que mudou. FONTE: HTTPS://CODEPEN.IO/GAEARON/PEN/GWOJEZ?EDITORS=1010 REACT DOM
INSERINDO ELEMENTO NO DOM <div id="root"></div> const element = <h1>Hello,
world!</h1>; ReactDOM.render( element, document.getElementById('root') ); .html .js
class HelloWorld extends React.Component { render() { return <div>Hello World
</ div>; } } root.render(<HelloWorld /> );
FONTE: HTTPS://BABELJS.IO/REPL BABEL
class HelloWorld extends React.Component { render() { return /*#__PURE__*/React.createElement("div", null,
"Hello World"); } } root.render( /*#__PURE__*/React.createElement(HelloWorld, null));
COMPONENTE DECLARATIVO function Welcome() { return <h1>Hello World</h1>; } class
Welcome extends React.Component { render() { return <h1>Hello World</h1>; } }
COMPONENTE DECLARATIVO const element = <h1>Hello, world!</h1>; ReactDOM.render( element, document.getElementById('root')
); <div id="root"></div>
COMPONENTE DECLARATIVO const element = <Welcome />; ReactDOM.render( element, document.getElementById('root')
); <div id="root"></div>
COMPONENTE DECLARATIVO ReactDOM.render( <Welcome />, document.getElementById('root') ); <div id="root"></div>
Props são imutáveis; States são mutáveis e quando seu valor
é alterado os métodos do ciclo de vida são executados. PROPS VS STATE
STATE E PROPS ReactDOM.render( <Welcome title="Senac" /> , document.getElementById('root') );
STATE E PROPS class Welcome extends React.Component { constructor(props) {
super(props); } render() { return ( <div> <h1>Hello, {this.props.title} < / h1> </ div> ); } }
STATE E PROPS class Welcome extends React.Component { constructor(props) {
super(props); } render() { return ( <div> <h1>Hello, {this.props.title} < / h1> // Hello, Senac </ div> ); } }
STATE E PROPS class Welcome extends React.Component { constructor(props) {
super(props); } render() { return ( <div> <h1>Hello, {this.props.title} < / h1> // Hello, Senac <button> {this.state.text} // undefined </ button> </ div> ); } }
STATE E PROPS class Welcome extends React.Component { constructor(props) {
super(props); this.state = { text: "não clicou" }; } render() { return ( <div> <h1>Hello, {this.props.title} < / h1> // Hello, Senac <button> {this.state.text} // não clicou </ button> </ div> ); } }
STATE E PROPS class Welcome extends React.Component { constructor(props) {
super(props); this.state = { text: "não clicou" }; } render() { return ( <div> <h1>Hello, {this.props.title} < / h1> // Hello, Senac <button onClick={() => this.setState({ text: "clicou"})} > {this.state.text} // não clicou </ button> </ div> ); } }
STATE E PROPS class Welcome extends React.Component { constructor(props) {
super(props); this.state = { text: "clicou" }; } render() { return ( <div> <h1>Hello, {this.props.title} < / h1> // Hello, Senac <button onClick={() => this.setState({ text: "clicou"})} > {this.state.text} // clicou </ button> </ div> ); } }
None
PRIMEIRO PASSO
PRIMEIRO PASSO Header
PRIMEIRO PASSO Order Options Header
PRIMEIRO PASSO Card Order Options Header
PRIMEIRO PASSO Card Title Card Image Card Description Card Info
Card Button Order Options Header Card
Jest; Typescript; React Router; Redux; Nextjs; Awesome-React. HTTPS://GITHUB.COM/ENAQX/AWESOME-REACT MUITA COISA…
FINE. I'LL DO IT MYSELF
PENSANDO DO JEITO REACT
- https://roadmap.sh/ HTTPS://GITHUB.COM/ENAQX/AWESOME-REACT ESTEJA PRONTO!
ROADMAP.SH
- https://roadmap.sh/ - https://github.com/felipe f ialho/frontend- challenges; - https://github.com/CollabCodeTech/ backend-challenges
-https://gefymarcos.com.br HTTPS://GITHUB.COM/ENAQX/AWESOME-REACT ESTEJA PRONTO!
14habits.com
OBRIGADO!
HTTPS://GITHUB.COM/GEFYMARCOS/MARVEL-REACT