Skip to content

Commit 84cf73a

Browse files
Roman86KevinVandyautofix-ci[bot]
authoredAug 3, 2024··
fix: id building was not consistent when using deep accessorKey (4754) (#5430)
* fix: id building was not consistent when using deep accessorKey (4754) * ci: apply automated fixes --------- Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 55da0c3 commit 84cf73a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎packages/table-core/src/core/column.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ export function createColumn<TData extends RowData, TValue>(
7979

8080
let id =
8181
resolvedColumnDef.id ??
82-
(accessorKey ? accessorKey.replace('.', '_') : undefined) ??
82+
(accessorKey
83+
? typeof String.prototype.replaceAll === 'function'
84+
? accessorKey.replaceAll('.', '_')
85+
: accessorKey.replace(/\./g, '_')
86+
: undefined) ??
8387
(typeof resolvedColumnDef.header === 'string'
8488
? resolvedColumnDef.header
8589
: undefined)

0 commit comments

Comments
 (0)
Please sign in to comment.