[英]How to show multiple components in a specific position inside of a parent component in react-native?
[英]How to pass multiple components dynamically inside other component react native
取決於您要存檔的內容。 您可以通過動態創建它們
const KennelScreen = () => {
return (
<SafeAreaView>
<ScrollView>
{React.Children.map(this.props.children, (child) =>
React.cloneElement(child)
)}
</ScrollView>
</SafeAreaView>
);
};
然后你可以在你的父屏幕中使用它
<KennelScreen>
<Header />
....
</KennelScreen>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.