The navigation bars that you've created so far in this chapter have been sort of plain. That's because you haven't configured them to do anything, so react-navigation will just render a plain bar with a back button. Each screen component that you create can configure specific navigation header content.
Let's build on the previous example, which used buttons to navigate to a details page:
- The App component stays the same, so let's take a look at the Home component first:
import React from "react";
import { View, Button } from "react-native";
import styles from "./styles";
export default function Home({ navigation }) {
return (
<View style={styles.container}>
<Button
title="First Item"
onPress={() =>
navigation.navigate("Details", {
title: "First Item",
content: "First Item Content",
stock: 1
...