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
React.js Life Cicle
Search
Raúl Palacios
May 13, 2019
Programming
0
19
React.js Life Cicle
Video de la presentación:
https://bit.ly/32kt9eT
Raúl Palacios
May 13, 2019
Tweet
Share
More Decks by Raúl Palacios
See All by Raúl Palacios
React Router VS MPA
raulpalacios
0
15
Other Decks in Programming
See All in Programming
雑に思考を整理する技術と効能
konifar
60
29k
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
180
dbtのドメイン分割による データ基盤の改善とDigdagとの連携
sakama
0
340
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
920
GitHub Copilotのススメ
marcy731
1
200
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
800
Elm Form Validation
bkuhlmann
0
510
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
200
Java 22 Overview
kishida
1
180
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
Elm 0.19.0 Changes
bkuhlmann
0
490
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Building a Scalable Design System with Sketch
lauravandoore
456
32k
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Bash Introduction
62gerente
604
210k
Building Applications with DynamoDB
mza
88
5.6k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
BBQ
matthewcrist
80
8.8k
Design by the Numbers
sachag
274
18k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Agile that works and the tools we love
rasmusluckow
325
20k
Transcript
Fases del ciclo de vida
Cada método tiene un prefijo will o did dependiendo de
si ocurren antes o después de cierta acción
MONTADO
constructor(props) • Inicializar el estado del componente • Enlazar eventos
• Setear variables globales Nota: El componente aun no se muestra
componentWillMount() • Modificar el estado • No realizar llamados a
API´s • No realizar suscripción a eventos Nota: El componente aun no se muestra
render() • Debe ser una funcion pura • No debe
modificar el estado Nota: El componente ya se muestra
componentDidMount() • El mejor momento para llamar API´s • Realizar
suscripciones a eventos • Modificar estado
ACTUALIZACIÓN
componentWillReceiveProps(nextProps) • Realizar cambios en los estados basado en las
nuevas propiedades
shouldComponentUpdate(nextProps, nextState) • Validar si queremos renderizar o no el
componente
componentWillUpdate(nextProps, nextState) • Realizar cualquier tipo de preparación Antes de
que se actualice la UI
render() • Debe ser una funcion pura • No debe
modificar el estado
componentDidUpdate(prevProps, prevState)
DESMONTADO
componentWillUnmount() • Dejar de escuchar eventos • Desuscribirse de un
WebSocket • Cancelar peticiones HTTP
ERRORES
componentDidCatch() • Control de errores