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

Suspense doesn't "resolve" for subsequent times if was suspended again #14013

Closed
ykravv opened this issue Oct 28, 2018 · 4 comments
Closed

Suspense doesn't "resolve" for subsequent times if was suspended again #14013

ykravv opened this issue Oct 28, 2018 · 4 comments

Comments

@ykravv
Copy link

ykravv commented Oct 28, 2018

Do you want to request a feature or report a bug?
Possibly a bug

What is the current behavior?
Repro demo: GitHub user search.
Type one character and wait after the list is rendered - everything works correctly. Subsequent fetches work this way.
Type two characters faster than results for the first character are rendered and fallback will never go although the second request is successful.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
https://codesandbox.io/s/k5v6ojz107

What is the expected behavior?
Suspense "resolves" with last resolved fetch and renders the list of users

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

react: 16.7.0-alpha.0
react-dom: 16.7.0-alpha.0
react-cache: 2.0.0-alpha.0

@vramana
Copy link

vramana commented Oct 29, 2018

image

I think that's intentional behaviour. Adding a key on the Suspense will fix it.

@aweary
Copy link
Contributor

aweary commented Oct 30, 2018

I don't think thats intentional, it should handle cases like this without requiring a key

@ykravv
Copy link
Author

ykravv commented Oct 30, 2018

At least it should emit some warning/error, not just quietly show fallback forever.

@gaearon
Copy link
Collaborator

gaearon commented Nov 2, 2018

This is definitely a bug

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

No branches or pull requests

4 participants