Skip to content
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

No obvious types for passing fallback data from server component to client component #414

Open
imownbey opened this issue Mar 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@imownbey
Copy link

Describe the bug
I am trying to type the result of fetchOffsetPaginationHasMoreFallbackData to pass it to a client component where it then gets passed as fallbackData. The closest I have found is:

type Result = Awaited<ReturnType<typeof recentBranchesQuery>> extends PostgrestResponseSuccess<infer T> ? T : never;

type Props = {
	fallbackData: {
		data: Result;
		hasMore: boolean;
	}[];
};

But I am not totally sure if this is actually correct, and it would be nice to include some helper types to do something similar? I am happy to open a PR with them.
To Reproduce
If possible, open a PR with a failing test. Otherwise, describe how to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@imownbey imownbey added the bug Something isn't working label Mar 17, 2024
@imownbey
Copy link
Author

Oops thsi should be enhancement not a bug

@psteinroe
Copy link
Owner

always happy to accept prs! 🫶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants