2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Access Props Using this.props
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Access Props Using this.props
|
|
|
|
|
|
|
|
|
2018-10-12 15:37:13 -04:00
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
## Solutions
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
For this solution you need to remember first how to add props to your parent component:
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
```JSX
|
2018-10-12 15:37:13 -04:00
|
|
|
<ReturnTempPassword tempPassWord="xxxxxxxx" />
|
|
|
|
```
|
|
|
|
|
|
|
|
Once you have the prop set, you can use this.props in your child component.
|
|
|
|
|
|
|
|
```html
|
|
|
|
<p>Your temporary password is: <strong>{this.props.tempPassword}</strong></p>
|
|
|
|
```
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
</details>
|