更新时间:2021-06-24 15:44:12
coverpage
Title Page
About Packt
Why subscribe?
Packt.com
Copyright and Credits
React Design Patterns and Best Practices Second Edition
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Section 1: Hello React!
Taking Your First Steps with React
Declarative programming
React elements
Unlearning everything
Common misconceptions
Summary
Clean Up Your Code
JSX
Babel 7
Hello World!
DOM elements and React components
Props
Children
Differences with HTML
Attributes
Style
Root
Spaces
Boolean attributes
Spread attributes
JavaScript templating
Common patterns
Multi-line
Multi-properties
Conditionals
Loops
Control statements
Sub-rendering
Code style
EditorConfig
Configuring EditorConfig
ESLint
Installation
Configuration
Git hooks
React plugin
Airbnb React/JSX style guide
The basics of functional programming
First-class objects
Purity
Immutability
Currying
Composition
FP and user interfaces
Section 2: How React works
Creating Truly Reusable Components
Creating classes
The createClass factory
Extending React.Component
The main differences
State
Autobinding
Stateless components
Props and context
The this keyword
Life cycle
Refs and event handlers
Optimization
Layout components
The state
External libraries
How it works
Asynchronous
Using the state
Derivables
The render method
React hooks
Prop types
React Docgen
Reusable components
Fragments
Compose All the Things
Communication between components
The container and presentational pattern