--- id: 5a24c314108439a4d4036169 title: Pass Props to a Stateless Functional Component challengeType: 6 isRequired: false videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions
هناك مكونات Calendar و CurrentDate في محرر التعليمات البرمجية. عند تقديم CurrentDate من مكون Calendar ، قم بتمرير خاصية date المعينة للتاريخ الحالي من كائن Date JavaScript. ثم قم بالوصول إلى هذا prop في مكون CurrentDate ، مع إظهار قيمته داخل علامات p . تجدر الإشارة إلى أنه بالنسبة إلى قيم prop أن يتم تقييمها على هيئة JavaScript ، يجب تضمينها في أقواس متعرجة ، على سبيل المثال date={Date()} .
## Tests
```yml tests: - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.children().type() === "div"; })(), "The Calendar component should return a single div element.");' - text: يجب أن يكون الطفل الثاني لمكون Calendar مكون CurrentDate . testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.children().childAt(1).name() === "CurrentDate"; })(), "The second child of the Calendar component should be the CurrentDate component.");' - text: يجب أن يكون لمكون CurrentDate دعامة date . testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.children().childAt(1).props().date })(), "The CurrentDate component should have a prop called date.");' - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); const prop = mockedComponent.children().childAt(1).props().date; return( typeof prop === "string" && prop.length > 0 ); })(), "The date prop of the CurrentDate should contain a string of text.");' - text: يجب أن يقوم مكون CurrentDate القيمة من date prop في علامة p . testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.find("p").html().includes(Date().substr(3)); })(), "The CurrentDate component should render the value from the date prop in the p tag.");' ```
## Challenge Seed
```jsx const CurrentDate = (props) => { return (
{ /* change code below this line */ }

The current date is:

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

What date is it?

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