This commit is contained in:
2022-04-10 18:01:29 +08:00
parent 342a79cb74
commit 9ba13b9a07
341 changed files with 0 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
/*
* @Author: chenxuan
* @Date: 2021-11-22 12:52:57
* @LastEditTime: 2022-01-19 15:38:43
* @LastEditors: chenxuan
*/
import React from "react";
import extendsHoc from './components/hoc/extends'
function NoStatusComponents(props) {
return (
<div>
{props.title}
<button type="button" onClick={props.sendParent.bind(this, "xxxx")}>
给父组件传值
</button>
</div>
);
}
class App extends React.Component {
constructor() {
super();
this.state = {
age: 30,
};
}
getValue(val) {
console.log(val);
}
render() {
return (
<div>
<NoStatusComponents
title="我是无状态子组件"
sendParent={this.getValue.bind(this)}
></NoStatusComponents>
<li>{this.props.title}</li>
<li>{this.props.name}</li>
</div>
);
}
}
export default extendsHoc(App,"高阶函数反向继承!");