Orders
const [tabs, tabDispatch] = useTabs()
| name | type | description |
|---|---|---|
tabs | array | With [currentTab, storedTabs] |
tabDispatch | function | tabDispatch(type, payload), see below |
tabDispatch(type, payload)| type | payload | description |
|---|---|---|
ADD | { id, ...restData } | Must include an unique id. Please aware this is for display tabs information not for panel, should not include all date in it. |
REMOVE | id | Remove a tab. |
NAVIGATE | id | To nav to specific tab, should use when onClick on tab. |
RESET | | Clear all tabs. |
ONLY | id | Clear all tabs except the given id. |