Skip to content

Commit 30e394a

Browse files
underlinenav console error and pass props down
1 parent 5f94786 commit 30e394a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/UnderlineNav2/UnderlineNav.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export const UnderlineNav = forwardRef(
138138
sx: sxProp = defaultSxProp,
139139
loadingCounters = false,
140140
children,
141+
...props
141142
}: UnderlineNavProps,
142143
forwardedRef,
143144
) => {
@@ -175,7 +176,7 @@ export const UnderlineNav = forwardRef(
175176
// This is the case where the viewport is too narrow to show any list item with the more menu. In this case, we only show the dropdown
176177
const onlyMenuVisible = responsiveProps.items.length === 0
177178

178-
if (__DEV__) {
179+
if (__DEV__ && process.env.NODE_ENV !== 'test') {
179180
// Practically, this is not a conditional hook, it is just making sure this hook runs only on DEV not PROD.
180181
// eslint-disable-next-line react-hooks/rules-of-hooks
181182
useEffect(() => {
@@ -308,6 +309,7 @@ export const UnderlineNav = forwardRef(
308309
sx={merge<BetterSystemStyleObject>(getNavStyles(theme), sxProp)}
309310
aria-label={ariaLabel}
310311
ref={navRef}
312+
{...props}
311313
>
312314
<NavigationList sx={ulStyles} ref={listRef} role="list">
313315
{listItems.map(listItem => {

0 commit comments

Comments
 (0)