Skip to content

Commit

Permalink
fix(Datagrid): return null for older react versions (#6003)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Sep 5, 2024
1 parent cf7c88c commit 6938654
Showing 1 changed file with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,25 @@ const useNestedRowExpander = (hooks) => {
const expanderTitle = row.isExpanded
? expanderButtonTitleExpanded
: expanderButtonTitleCollapsed;
return (
(row.canExpand || getAsyncSubRows) && (
<button
type="button"
aria-label={expanderTitle}
className={cx(
`${blockClass}__row-expander`,
`${carbon.prefix}--btn`,
`${carbon.prefix}--btn--ghost`
)}
{...expanderButtonProps}
>
<ChevronRight
className={cx(`${blockClass}__expander-icon`, {
[`${blockClass}__expander-icon--not-open`]: !row.isExpanded,
[`${blockClass}__expander-icon--open`]: row.isExpanded,
})}
/>
</button>
)
);
return row.canExpand || getAsyncSubRows ? (
<button
type="button"
aria-label={expanderTitle}
className={cx(
`${blockClass}__row-expander`,
`${carbon.prefix}--btn`,
`${carbon.prefix}--btn--ghost`
)}
{...expanderButtonProps}
>
<ChevronRight
className={cx(`${blockClass}__expander-icon`, {
[`${blockClass}__expander-icon--not-open`]: !row.isExpanded,
[`${blockClass}__expander-icon--open`]: row.isExpanded,
})}
/>
</button>
) : null;
},
width: 48,
disableResizing: true,
Expand Down

0 comments on commit 6938654

Please sign in to comment.