diff --git a/packages/react/src/components/DataTable/tools/sorting.js b/packages/react/src/components/DataTable/tools/sorting.js index 7fc2f51b26b4..373533a13412 100644 --- a/packages/react/src/components/DataTable/tools/sorting.js +++ b/packages/react/src/components/DataTable/tools/sorting.js @@ -35,8 +35,8 @@ export const compare = (a, b, locale = 'en') => { // if column has React elements, this should sort by the child string if there is one if (typeof a === 'object' && typeof b === 'object') { if ( - typeof a.props.children === 'string' && - typeof b.props.children === 'string' + typeof a.props?.children === 'string' && + typeof b.props?.children === 'string' ) { return compareStrings(a.props.children, b.props.children, locale); }