Skip to content

Commit

Permalink
fix: id building was not consistent when using deep accessorKey (4754) (
Browse files Browse the repository at this point in the history
#5430)

* fix: id building was not consistent when using deep accessorKey (4754)

* ci: apply automated fixes

---------

Co-authored-by: Kevin Van Cott <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 3, 2024
1 parent 55da0c3 commit 84cf73a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/table-core/src/core/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ export function createColumn<TData extends RowData, TValue>(

let id =
resolvedColumnDef.id ??
(accessorKey ? accessorKey.replace('.', '_') : undefined) ??
(accessorKey
? typeof String.prototype.replaceAll === 'function'
? accessorKey.replaceAll('.', '_')
: accessorKey.replace(/\./g, '_')
: undefined) ??
(typeof resolvedColumnDef.header === 'string'
? resolvedColumnDef.header
: undefined)
Expand Down

0 comments on commit 84cf73a

Please sign in to comment.