Vince liu
faceach@gmail.com
If the data is going to change in component, you should use state.
In general, you should initialize state in the constructor, and then call setState() when you want to change it.
setState()
A
Components could be created by customized data. These customized data are called props.
{...props}
A
B
Components could be created by customized data. These customized data are called props.
B
A
{...props}
setState()
{...props}
callback()
A
B
C
D
E
A
B
C
D
E
Event 1
Event 2
Event 3
Event 4
Event 5
A
C
B
D
Application state
{...props}
{...props}
{...props}
{...props}
Action creator
Store
View
Dispatch actions
Reducer
Provider + connect
listen to {state, actions}
and user behavior
Business logic goes here
Global app state
store.subscribe()
store.dispatch()
update state
Store
Act
View
Store
Act
View
Store
Act
View
C
A
B
Reducer C
Act
View
Reducer A
Act
View
Reducer B
Act
View
C
A
B
Top-Level Exports
Store API
is only concerned with