From 8a4c8cb1e607d2453b8c2238b3e82d2bc572f861 Mon Sep 17 00:00:00 2001 From: chenxuan Date: Mon, 17 Jan 2022 00:28:49 +0800 Subject: [PATCH] xxx --- B/7/index.html | 41 +++++++++++++++++++ B/7/read.text | 2 + 高阶函数/exercise9/src/App.js | 9 +++- 高阶函数/exercise9/src/components/proxyHoc.js | 11 +++-- 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 B/7/index.html create mode 100644 B/7/read.text diff --git a/B/7/index.html b/B/7/index.html new file mode 100644 index 000000000..3b52f2ea7 --- /dev/null +++ b/B/7/index.html @@ -0,0 +1,41 @@ + + + + + + + + Document + + +
+ + + + + + \ No newline at end of file diff --git a/B/7/read.text b/B/7/read.text new file mode 100644 index 000000000..b32c6a441 --- /dev/null +++ b/B/7/read.text @@ -0,0 +1,2 @@ +1、diffing算法 +2、循环时key的原理 \ No newline at end of file diff --git a/高阶函数/exercise9/src/App.js b/高阶函数/exercise9/src/App.js index 135071372..03fdc75ff 100644 --- a/高阶函数/exercise9/src/App.js +++ b/高阶函数/exercise9/src/App.js @@ -1,6 +1,13 @@ +/* + * @Author: chenxuan + * @Date: 2021-11-21 15:55:16 + * @LastEditTime: 2022-01-15 00:21:58 + * @LastEditors: chenxuan + */ import React from 'react' import proxyHoc from './components/proxyHoc' const Chenxuan=proxyHoc((props)=>{ + console.log(props) return(

{props.title}

@@ -17,7 +24,7 @@ class App extends React.Component{ render(){ return(
- +
) } diff --git a/高阶函数/exercise9/src/components/proxyHoc.js b/高阶函数/exercise9/src/components/proxyHoc.js index 481f370b7..66d62609a 100644 --- a/高阶函数/exercise9/src/components/proxyHoc.js +++ b/高阶函数/exercise9/src/components/proxyHoc.js @@ -1,10 +1,16 @@ +/* + * @Author: chenxuan + * @Date: 2021-11-21 15:55:16 + * @LastEditTime: 2022-01-15 00:19:25 + * @LastEditors: chenxuan + */ import React from 'react' function Hehe(WithComponent){ return class HocComponent extends React.Component{ constructor(){ super(); this.state={ - userName:"" + userName:"666" } } setUsername(e){ @@ -17,9 +23,8 @@ function Hehe(WithComponent){ value:this.state.userName } }; - + console.log(this.props) return( -
  • {this.state.userName}