I am trying to make tab navigation for a section on an app that I'm working on, though I am having some trouble. It was working a while ago but for some reason, it's not displaying the different tabs to click on.
I am still fairly new to React and JS so I'm having a hard time following the code that I wrote before. (also, I'm not sure why I am not using the HandleChange but I remember that I need it)
Here is my code:
import React from "react";
import InfoText from "./InfoComponent";
import TransportationText from "./TransportationComponent";
import Hotels from "./HotelsComponent";
import FAQ from "./FAQComponent";
import Covid from "./CovidComponent";
const TravelersTab = () => {
const [selectedTab, setSelectedTab] = React.useState(0);
const handleChange = (event, newValue) => {
setSelectedTab(newValue);
};
return (
<div
position="static"
>
<h1 style={{
textAlign: "center"
}}>Travelers</h1>
{selectedTab === 0 && <InfoText />}
{selectedTab === 1 && <Hotels />}
{selectedTab === 2 && <TransportationText />}
{selectedTab === 3 && <Covid />}
{selectedTab === 4 && <FAQ />}
</div>
);
};
export default TravelersTab;
Here is a picture of what I am seeing:

If anyone has any information that would be helpful, that would be much appreciated! Thanks for taking the time to help me out!! : )