Files
freeCodeCamp/guide/arabic/react-native/props/index.md
Randell Dawson d6a160445e Convert single backtick code sections to triple backtick code sections for Arabic Guide articles (13 of 15) (#36240)
* fix: converted single to triple backticks13

* fix: added prefix

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: removed language in wrong place

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: add language postfix

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>

* fix: removed language in wrong place

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>
2019-06-20 18:07:24 -05:00

65 lines
1.9 KiB
Markdown

---
title: Props
localeTitle: الدعائم
---
## رد الفعل الأصلية - الدعائم
المصطلح الدعائم ، اختصارًا لـ "الخصائص" ، يعني نوعًا من البيانات التي يتم تمريرها من أحد المكونات إلى آخر. تتدفق الدعائم دائمًا من المكون الرئيسي إلى الطفل.
في React ، يستطيع المكون الفرعي الوصول إلى المعلومات من أحد الوالدين عبر الدعائم:
```jsx
// the child Header component receives the text prop and can access it via this.props.text
class Header extends Component {
render () {
return (
<Text>{this.props.text}</Text>
)
}
}
class App extends Component {
render () {
return (
<Header text="Welcome!" />
);
}
}
```
هذا أيضا يعمل بنفس الطريقة في المكونات الوظيفية:
`// in functional components, props will be received as a parameter 'props'
const Header = (props) => {
return (
<Text>{props.title}</Text>
);
};
class App extends Component {
render () {
return (
<View>
<Header text="Welcome!" />
</View>
);
}
}
`
ستتيح لك المكتبات الأخرى التي تقوم باستيرادها الوصول إلى خصائص إضافية داخل المكونات الخاصة بك. فيما يلي مثال من مكتبة [العناصر](https://github.com/react-native-training/react-native-elements) المتفاعلة [الأصلية](https://github.com/react-native-training/react-native-elements) .
``import { Button } from 'react-native-elements';
// here 'buttonStyle' and 'title' are props passed into the Button component
class App extends Component {
render () {
return (
<Button
buttonStyle={{backgroundColor: 'red', borderRadius: 10}}
title={`Submit`}
/>
);
}
}
``