Skip to content

Annotae Grid and List return types explicitly to avoid redundant inlined inferred types#876

Merged
bvaughn merged 6 commits into
bvaughn:masterfrom
Andarist:fix/return-type-serialization
Oct 26, 2025
Merged

Annotae Grid and List return types explicitly to avoid redundant inlined inferred types#876
bvaughn merged 6 commits into
bvaughn:masterfrom
Andarist:fix/return-type-serialization

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

fixes #875

@vercel

vercel Bot commented Oct 25, 2025

Copy link
Copy Markdown

@Andarist is attempting to deploy a commit to the Brian Vaughn's projects Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread lib/components/grid/Grid.tsx Outdated
Comment thread lib/components/grid/Grid.tsx Outdated
@Andarist
Andarist force-pushed the fix/return-type-serialization branch from 3dd1b4c to aea1dc5 Compare October 25, 2025 21:13
@bvaughn

bvaughn commented Oct 26, 2025

Copy link
Copy Markdown
Owner

Wow! This is very kind of you. Thanks, @Andarist!

@vercel

vercel Bot commented Oct 26, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
react-window Ready Ready Preview Oct 26, 2025 8:39pm

@bvaughn

bvaughn commented Oct 26, 2025

Copy link
Copy Markdown
Owner

Just tested this and it works with React 18.3+ and 19.0+ but it fails with React <= 18.2:

src/App.tsx:15:25 - error TS2339: Property 'index' does not exist on type '{}'.

15 function RowComponent({ index, style }: RowComponentProps<object>) {

The underlying cause of which is:

Module '"react"' has no exported member 'JSX'.ts(2305)

Replacing the JSX return type with ReactElement<any, any> causes a different underlying issue for CellComponentProps and RowComponentProps that also breaks the build:

Type 'ReactNode' is not assignable to type 'ReactElement<any, any> | null'.

Though I think that one can be fixed by changing the return type annotation for cellComponent and rowComponent to also be ReactElement.

@bvaughn
bvaughn merged commit 5d59563 into bvaughn:master Oct 26, 2025
6 checks passed
@bvaughn bvaughn mentioned this pull request Oct 26, 2025
@Andarist

Copy link
Copy Markdown
Contributor Author

Wow! This is very kind of you. Thanks, @Andarist!

Always happy to help out :)

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.

tsc error with 2.2.1

2 participants