--- id: 5a24c314108439a4d403616e title: Access Props Using this.props challengeType: 6 isRequired: false videoUrl: '' localeTitle: '' --- ## Description
غطت التحديات الأخيرة عدة الطرق الأساسية لتمرير الدعائم لمكونات الطفل. ولكن ماذا لو كان المكون الفرعي الذي تقوم بتمرير دعم له مكون فئة ES6 بدلاً من مكون وظيفي عديم الحالة؟ يستخدم مكون الفئة ES6 اصطلاحًا مختلفًا قليلاً للوصول إلى الدعائم. في أي وقت تشير إلى مكون فئة داخل نفسه ، يمكنك استخدام this الكلمة. للوصول إلى الدعائم داخل مكون فئة ، يمكنك تهيئة الرمز الذي تستخدمه للوصول إليه باستخدام this العنصر. على سبيل المثال ، إذا كان مكون فئة ES6 يحتوي على دعامة تسمى data ، {this.props.data} في {this.props.data} .
## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); return mockedComponent.children().type() === "div"; })(), "The ResetPassword component should return a single div element.");' - text: الطفل الرابع من ResetPassword يجب أن يكون ReturnTempPassword المكون. testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); return mockedComponent.children().childAt(3).name() === "ReturnTempPassword"; })(), "The fourth child of ResetPassword should be the ReturnTempPassword component.");' - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); return mockedComponent.find("ReturnTempPassword").props().tempPassword; })(), "The ReturnTempPassword component should have a prop called tempPassword.");' - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); const temp = mockedComponent.find("ReturnTempPassword").props().tempPassword; return typeof temp === "string" && temp.length >= 8; })(), "The tempPassword prop of ReturnTempPassword should be equal to a string of at least 8 characters.");' - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); return mockedComponent.find("strong").text() === mockedComponent.find("ReturnTempPassword").props().tempPassword; })(), "The ReturnTempPassword component should display the password you create as the tempPassword prop within strong tags.");' ```
## Challenge Seed
```jsx class ReturnTempPassword extends React.Component { constructor(props) { super(props); } render() { return (
{ /* change code below this line */ }

Your temporary password is:

{ /* change code above this line */ }
); } }; class ResetPassword extends React.Component { constructor(props) { super(props); } render() { return (

Reset Password

We've generated a new temporary password for you.

Please reset this password from your account settings ASAP.

{ /* change code below this line */ } { /* change code above this line */ }
); } }; ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```