Skip to content

Conversation

@saperdadsk
Copy link
Contributor

The typing for React.key has been changed to include 'bigint' (DefinitelyTyped/DefinitelyTyped#66723). React Team recommends not using this type for our own keys (specifically for object indexing types - see DefinitelyTyped/DefinitelyTyped#66749 (comment)). Attempting to use it as we do (specifically in sortState) causes an error when using @types/react@18, since typescript doesn't allow bigint as index type. Though this library doesn't officially support React 18, hardcoding the old type of string | number will at least prevent consumers' typechecking from breaking if they do use React 18.

The typing for React.key has been changed to include 'bigint' (DefinitelyTyped/DefinitelyTyped#66723). React Team recommends not using this type for our own keys (specifically for object indexing types - see DefinitelyTyped/DefinitelyTyped#66749 (comment)). Attempting to use it as we do (specifically in `sortState`) causes an error when using @types/react@18, since typescript doesn't allow bigint as index type. Though this library doesn't officially support React 18, hardcoding the old type of string | number will at least prevent consumers' typechecking from breaking if they do use React 18.
Copy link
Contributor

@tonnyskk tonnyskk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'll add an extra commit to update package.json.

@tonnyskk tonnyskk merged commit 9ef8cc0 into Autodesk:master May 24, 2024
@saperdadsk saperdadsk deleted the update_react_key_typing branch May 24, 2024 14:23
jc99ta pushed a commit to jc99ta/react-base-table that referenced this pull request May 29, 2024
The typing for React.key has been changed to include 'bigint' (DefinitelyTyped/DefinitelyTyped#66723). React Team recommends not using this type for our own keys (specifically for object indexing types - see DefinitelyTyped/DefinitelyTyped#66749 (comment)). Attempting to use it as we do (specifically in `sortState`) causes an error when using @types/react@18, since typescript doesn't allow bigint as index type. Though this library doesn't officially support React 18, hardcoding the old type of string | number will at least prevent consumers' typechecking from breaking if they do use React 18.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants