in my application I use generic Tabs functional component:
export default function Tabs() {
const [currentTabIndex, setCurrentTabIndex] = useState(0);
[...]
}
Now in my BookingPage
I need to change the currentTabIndex
of this Tabs
component,
depending on Redux Store:
export default function BookingPage()
const userCreatedBooking = useSelector([...]); // whenever this value change, I want
// to invoke Tabs.setCurrentIndex
return (
<>
<Tabs tabs=[SubPage1, SubPage2]/>
<>
What's a clean way to achieve above? Thanks;)