From 04776ddfa217a491e84a5d6079053f9195d6883a Mon Sep 17 00:00:00 2001 From: chenxuan Date: Fri, 14 Jan 2022 00:53:52 +0800 Subject: [PATCH] xxx --- B/6/P05.html | 6 ++-- B/6/P06.html | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ B/6/P07.html | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 3 deletions(-) create mode 100644 B/6/P06.html create mode 100644 B/6/P07.html diff --git a/B/6/P05.html b/B/6/P05.html index ba6984df9..aba6c99be 100644 --- a/B/6/P05.html +++ b/B/6/P05.html @@ -1,7 +1,7 @@ @@ -10,7 +10,7 @@ - 生命周期函数 + getDerivedStateFromProps @@ -38,7 +38,7 @@ this.forceUpdate() } // 定义在类自身,接收props state两个参数,必须返回状态对象 - // 返回状态对象后会劫持原有props + // 返回状态对象后会劫持原有state state的值由props决定 static getDerivedStateFromProps(props,state){ console.log(props,state) return props diff --git a/B/6/P06.html b/B/6/P06.html new file mode 100644 index 000000000..65b705712 --- /dev/null +++ b/B/6/P06.html @@ -0,0 +1,77 @@ + + + + + + + + getSnapshotBeforeUpdate + + + + + +
+ + + \ No newline at end of file diff --git a/B/6/P07.html b/B/6/P07.html new file mode 100644 index 000000000..08e902ea6 --- /dev/null +++ b/B/6/P07.html @@ -0,0 +1,74 @@ + + + + + + + + Document + getSnapshotBeforeUpdate + + + + + + +
+ + + + \ No newline at end of file