I have a component of primereact .
<TabView >
<TabPanel header="Panel 1">
</TabPanel>
<TabPanel header="Panel 2">
</TabPanel>
</TabView>
How can I show / hide a tab according to a specific value?
I have a component of primereact .
<TabView >
<TabPanel header="Panel 1">
</TabPanel>
<TabPanel header="Panel 2">
</TabPanel>
</TabView>
How can I show / hide a tab according to a specific value?
You can have a list of tabs to show and modify the list when it suits you:
const tabs = [1, 2]; //Esta lista es la que tienes que generar mirando condiciones
const listItems = tabs.map((number) =>
<TabPanel header="Panel {number}"></TabPanel>
);
and then do something like
return (<TabView > {listItems} </TabView>);