xxxxxxxxxx
const sorter = (a, b) => (isNaN(a) && isNaN(b) ? (a || '').localeCompare(b || '') : a - b);
// Usage example with antd table column
[
{
title: 'Status',
dataIndex: 'status',
key: 'status',
width: '10%',
// status can be Number or String
sorter: (a, b) => sorter(a.status, b.status),
render: Name
}
]