question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to deal with suspend?

See original GitHub issue

I am mostly curious what was the initial motivation to have suspend = true by default already. There is a lack of information on how to actually use suspense for data fetching considering that it’s planned for late 2019.

I just got burned by this badly when I forgot to set it false for one component deep down in the tree. I do have a Suspense way up in a tree to handle React.lazy. Suddenly when a query was rerun due to variables changing, everything got unmounted and fallback to top-level Suspense. It took me a while and some debugging to realize the culprit.

Do you have some actual examples of how to integrate it with react-apollo-hooks? Is it someone using it successfully already or is it everyone switching it off?

Let’s consider a pretty simple scenario. A component that has useQuery and renders some markup with data from that query. Now with loading prop the decision what to show is done deeper in the tree. However, with suspension in play, it has to be done at top levels? I just cannot wrap my head around this for some reason.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:31 (15 by maintainers)

github_iconTop GitHub Comments

27reactions
darrentorpeycommented, Mar 14, 2019

Just wanted to say this was a helpful, high-quality conversation and I appreciate the change (@trojanowski) to make Suspense opt-in. It lowers the barriers to entry and will allow more people to start using this library with far less trouble and confusion. 👍

22reactions
gaearoncommented, Feb 5, 2019

FWIW lack of features like this is part of the reasons we don’t recommend anyone to start using Suspense for data fetching now. (The feature you’re asking for is essentially a render prop API for switching between fallback and main content. It’s planned but not ready yet.)

It doesn’t hurt to experiment with it but I think we should be clear that Suspense data fetching story (and patterns around it essential to creating good UX) is not ready for prime time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Deal with Your Child Being Suspended from School
Talk to your child about how they could have handled things differently. Use the suspension as a teachable moment. Help your child come...
Read more >
What to Do When Your Child or Teen is Suspended or ...
If your child is not of an age where he can stay home alone, you will need to come up with some sort...
Read more >
What To Do When Your Child Gets Suspended or Expelled
You just found out that your child has been suspended or expelled from school. Natural reactions might include: shock, confusion, embarrassment, or anger....
Read more >
4 Ways to Punish a Child that Was Suspended from School
1. Focus on having your child make up for their wrongdoing. Come up with consequences that teach your child how to correct their...
Read more >
How to deal with a temporary suspension and restarting your ...
There is little guidance in the literature as to how to manage such a temporary suspension. In this paper, we describe the temporary...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found