Skip to content

Common Patterns for React? onCompleted callbacks? #3458

Discussion options

You must be logged in to vote

Disclaimer: I know this got quite long, sorry! But the tl;dr here is that:

  • external state stores aren't quite as straightforward (nor the best solution for problems most of the time) than they seem,
  • effects and synchronising state while avoiding tearing is what you want, but without knowing that it's hard to explain what you're looking for
  • you can still call into client.query directly, inside of an effect, use an effect on useQuery's output (which delays further state updates, causing tearing though), or directly update your state in render (which is an “advanced” pattern and must be used with caution, so I wouldn't recommend it)
    • tl;dr: there be dragons
  • and lastly, there's some proble…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@JacksonChristopherHowell
Comment options

@JoviDeCroock
Comment options

@JacksonChristopherHowell
Comment options

@kitten
Comment options

Answer selected by JacksonChristopherHowell
@JacksonChristopherHowell
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants