lets suppose we got the following:
Navigation screen:
<Drawer.Navigator
initialRouteName="Home"
drawerContent={props => {
return (
<DrawerContentScrollView {...props}>
<DrawerItemList {...props} />
<DrawerItem label="Scroll to aboutus"/>
</DrawerContentScrollView>
)}
}>
<Drawer.Screen options={{
drawerLabel: 'Home',
title: ''
}} name="Home" component={HomeScreen} />
</Drawer.Navigator>
Home screen:
export default function Home() {
return (
<ScrollView>
<View>
<Text>One</Text>
</View>
<View style={{marginTop:100}}>
<Text>two</Text>
</View>
<View style={{marginTop:100}}>
<Text>three</Text>
</View>
<View style={{marginTop:100}}>
<Text>four</Text>
</View>
<AboutUs/>
</ScrollView>
);
}
How could I use this DrawerItem kinda like an anchor linked to about us, so when I click on it my scrollview gets scrolled to the <AboutUs/> part?