How to view a multiple components in a sub component ?
More details : I have a page that includes 4 horizontal sliders .. so I made every slider as a separated component under this names (firstSlider.js, secondSlider.js....) and need to view all these sliders in a sub component called "explore.js" (It's an empty component file to just view this sliders) .. and rendering explore.js through the App.js
Any solution ?
import React, { Component } from 'react';
import FirstSlider from './firstSlider'
import SecondSlider from './secondSlider'
import ThirdSlider from './secondSlider'
export default function AppPortal(){
return (
<>
<FirstSlider />
<SecondSlider />
<ThirdSlider />
</>
);
};
explore.js
import React from 'react';
import { Text, SafeAreaView, ScrollView, Image, Item, View, TouchableOpacity } from 'react-native';
import styles from './../../styles/explore'
export default function ThirdSlider(){
return (
<SafeAreaView style={styles.container}>
<ScrollView style={styles.scrollView} horizontal={true} >
<Text style={styles.sldrTtlStl}>Most eaten</Text>
....Rest of the code
</ScrollView>
</SafeAreaView>
);
}
thirdSlider.js and the rest sliders are the same
they all on top of each other