@campxdev/shared 1.11.39 → 1.11.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.11.39",
3
+ "version": "1.11.40",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -27,14 +27,14 @@ export default function TabsContainer({
27
27
  tabMobileUnderlineColor,
28
28
  currentTabIndex = 0,
29
29
  }: TabsContainerProps) {
30
- const [currentTab, setCurrentTab] = useState(tabs[currentTabIndex].key)
30
+ const [currentTab, setCurrentTab] = useState(tabs[currentTabIndex]?.key)
31
31
 
32
32
  const handleTabsChange = (_event: ChangeEvent<{}>, value: string): void => {
33
33
  setCurrentTab(value)
34
34
  onTabChange && onTabChange(value)
35
35
  }
36
36
  useEffect(() => {
37
- setCurrentTab(tabs[currentTabIndex].key)
37
+ setCurrentTab(tabs[currentTabIndex]?.key)
38
38
  }, [])
39
39
 
40
40
  return (
@@ -53,9 +53,9 @@ export default function TabsContainer({
53
53
  >
54
54
  {tabs.map((tab) => (
55
55
  <Tab
56
- key={tab.key}
56
+ key={tab?.key}
57
57
  label={tab.label}
58
- value={tab.key}
58
+ value={tab?.key}
59
59
  icon={tab.highlight ? <span>{'.'}</span> : null}
60
60
  iconPosition="end"
61
61
  />
@@ -63,7 +63,7 @@ export default function TabsContainer({
63
63
  </StyledTabs>
64
64
  <StyledComponentWrapper containerVariant={containerVariant}>
65
65
  <ErrorBoundary>
66
- {tabs.find((tab) => tab.key === currentTab)?.component}
66
+ {tabs.find((tab) => tab?.key === currentTab)?.component}
67
67
  </ErrorBoundary>
68
68
  </StyledComponentWrapper>
69
69
  </StyledContainer>