Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
React学习手册
by
Alex Banks
,
Eve Porcello
December 2017
Intermediate to advanced
329 pages
6h 9m
Chinese
China Electric Power Press Ltd.
Content preview from
React学习手册
140
第
7
章
组件扩展
目前为止,我们已经学习了如何使用
React
挂载和合成组件来创建应用表现层。只使
用
React
组件的
render
方法构建应用程序的可能性微乎其微。不过,
JavaScript
的世界
是纷繁复杂的。到处都存在异步应用。在载入数据时需要处理延迟问题。创建动画时
还需要延迟执行相关操作。极有可能读者已经有偏爱的
JavaScript
库来帮助你在复杂
而真实的
JavaScript
世界乘风破浪了。
在我们能够使用第三方
JavaScript
库或者后端数据请求扩展我们的应用程序之前,我
们必须首先充分了解如何使用组件生命周期,即每次我们挂载或更新组件过程中一系
列可以调用的方法。
本章的内容将会以探索组件生命周期开始。在我们介绍了生命周期之后,将会重新
审视如何使用它载入数据、集成第三方
JavaScript
库,以及改进用户的组件性能。然
后,我们将介绍如何使用高阶组件实现应用程序之间的功能复用。最后,我们将会以
介绍使用其他应用程序架构管理
React
之外的
State
作为本章结尾。
组件生命周期
组件生命周期包含挂载或者更新组件过程中被触发的一系列方法。这些方法可以在组
件渲染
UI
之前或者之后被触发。事实上,
render
方法本身就是组件生命周期的一部
分。有两种主要的生命周期:挂载生命周期和更新生命周期。
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
React快速上手开发
Stoyan Stefanov
流畅的Python
Luciano Ramalho
C++语言导学(原书第2版)
本贾尼 斯特劳斯特鲁普
C++程序设计:原理与实践(基础篇)(原书第2版)
本贾尼 斯特劳斯特鲁普
Publisher Resources
ISBN: 9787519814236