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

Update docs on usePaginationFragement & transitions in Relay tutorial. #4842

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielstocks
Copy link
Contributor

I found out that useTransition doesn't work when using usePaginationFragement. To get it to work the way it's intended in the tutorial I had to use isLoadingNext boolean prop that is returned from usePaginationFragement instead. Not sure if this a bug, or by design.

As a beginner, I spent quite some time trying to figure out why my code wasn't working, after a bit of digging I ran into some potenially related issues:

In this PR I've updated the code in "Improving the Loading Experience with useTransition" example not to confuse newcomers. Also the section about "results that aren’t immediate should be wrapped in a React transition" as it no longer applies in this particular context.

I also replaced <CommentsLoadingSpinner /> (which doesn't exist?) with <SmallSpinner /> which seems more appropriate in the particular example.

I found out that `useTransition` doesn't work when using `usePaginationFragement`. To get it to work the way it's intended in the tutorial I had to use `isLoadingNext` boolean prop that is returned from `usePaginationFragement` instead. Not sure if this a bug, or by design.

As a beginner, I spent quite some time trying to figure out why my code wasn't working, after a bit of digging I ran into some potenially related issues:
- facebook#4531 (comment)
- facebook#4526
- facebook#3082

In this PR I've updated the "Improving the Loading Experience with useTransition" example not to confuse newcomers.
@danielstocks danielstocks changed the title Update docs on usePaginationFragement & transitions in Relay Tutorial. Update docs on usePaginationFragement & transitions in Relay tutorial. Nov 7, 2024
@captbaritone
Copy link
Contributor

Sorry for the confusion this caused! I'll import and we can look into if this is expected behavior or not.

@facebook-github-bot
Copy link
Contributor

@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants