-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(virtual-core): add bigint to Key to align with @types/react implementation #814
Conversation
If changed like that, it might be more convenient when using React. However, Should the higher-level element 'core' depend on the lower-level element 'react'? const alsoHuge = BigInt(9007199254740991);
alsoHuge.toString(); |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 892a4d5. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
@SaeWooKKang allowing bigint as key is not really connected to react |
Yes, the problem is when you use |
You're right, there isn't a direct connection. However, my comment was about whether it's appropriate to add a type to the key specifically for the purpose of using it with React.
Is there no need to modify the documentation for the type? |
Yep, thanks for the input. I think we are fine here, as bigint is overall an primitive not a react thing.
good catch, @huv1k can you update docs at https://github.com/TanStack/virtual/blob/main/docs/api/virtual-item.md |
Updated 🙌 |
Why not just use the React type for keys? |
As core should not be bound to any lib, adding the bigint created other issues like #819 |
Fair enough, I forgot that the core can be used across different frameworks |
This PR enhances
Key
type withbigint
to align withReact.Key
. This was updated in DefinitelyTyped/DefinitelyTyped#66723. This will enable us to useReact.Key
as type for where we requireKey
as type.