I'm trying to use the Mui component tabs and I would like to load another component inside this tab, in this case Occurrence component:
import * as React from 'react';
import Box from '@mui/material/Box';
import Tab from '@mui/material/Tab';
import TabContext from '@mui/lab/TabContext';
import TabList from '@mui/lab/TabList';
import TabPanel from '@mui/lab/TabPanel';
export default function LabTabs() {
const [value, setValue] = React.useState('1');
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
setValue(newValue);
};
return (
<Box sx={{ width: '100%', typography: 'body1' }}>
<TabContext value={value}>
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
<TabList onChange={handleChange} aria-label="lab API tabs example">
<Tab label="Item One" value="1" />
<Tab label="Item Two" value="2" />
<Tab label="Item Three" value="3" />
</TabList>
</Box>
<TabPanel value="1"><></TabPanel>
<TabPanel value="2">Item Two</TabPanel>
<TabPanel value="3">Item Three</TabPanel>
</TabContext>
</Box>
);
}
However, the Occurrence component is declared like this:
export const Occurrence = (props: RouteComponentProps<{ url: string }>) => {
const dispatch = useAppDispatch();
const [search, setSearch] = useState('');
const [paginationState, setPaginationState] = useState(
overridePaginationStateWithQueryParams(getSortState(props.location, ITEMS_PER_PAGE, 'id'), props.location.search)
);
const occurrenceList = useAppSelector(state => state.occurrence.entities);
const loading = useAppSelector(state => state.occurrence.loading);
const totalItems = useAppSelector(state => state.occurrence.totalItems);
This Occurrence component was automatically generated by JHipster. So my problem is, how can I load it when I have to pass a URL as a parameter?