diff --git a/13-React基础/05-React中绑定this并给函数传参的几种方式.md b/13-React基础/05-React中绑定this并给函数传参的几种方式.md new file mode 100644 index 0000000..9315fc9 --- /dev/null +++ b/13-React基础/05-React中绑定this并给函数传参的几种方式.md @@ -0,0 +1,242 @@ + + +## 前言 + +我们先来看下面这段代码: + +components/MyComponent.jsx + +```javascript +import React from "react"; + +export default class MyComponent extends React.Component { + constructor(props) { + super(props); + + this.state = { + msg: "这是 MyComponent 组件 默认的msg" + }; + } + + render() { + return ( +