freeCodeCamp/guide/chinese/certifications/front-end-libraries/react/access-props-using-this-props/index.md

18 lines
369 B
Markdown

---
title: Access Props Using this.props
localeTitle: 使用this.props访问道具
---
## ##使用this.props访问道具
对于此解决方案,您需要首先记住如何将道具添加到父组件:
\`\`\`JSX
```
Once you have the prop set, you can use this.props in your child component.
```
HTML
您的临时密码是: **{this.props.tempPassword}**
\`\`\`