Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Throwing a runtime bug with useQuery and Fast Refresh (new React hot reloader) #3480

Closed
jfrolich opened this issue Sep 10, 2019 · 0 comments · Fixed by #3490
Closed

Throwing a runtime bug with useQuery and Fast Refresh (new React hot reloader) #3480

jfrolich opened this issue Sep 10, 2019 · 0 comments · Fixed by #3490

Comments

@jfrolich
Copy link
Contributor

Intended outcome:
Refresh of component. Hook state should be preserved.

Actual outcome:
On a fast refresh useQuery runs into a runtime error. See details in the image below. It seems that a value is undefined that is assumed to be defined. I think it is failing at this line:

const currentResult = this.currentObservable.query!.getCurrentResult();

Interestingly there is a typescript nullability override, so maybe that is an assumption that we cannot make in the world of fast refresh?

image

How to reproduce the issue:

Run any useQuery in React-Native 0.61 RC2.

Version
@apollo/hooks 3.10
React-Native 0.61 RC2

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

Successfully merging a pull request may close this issue.

1 participant