useQuery `pollInterval` stop working in React v18 StrictMode
See original GitHub issueIntended outcome:
pollInterval
should work either with React v18 StrictMode or without StrictMode
Actual outcome:
pollInterval
stop working when using it with React v18 StrictMode
How to reproduce the issue:
- Go to https://codesandbox.io/s/heuristic-bohr-df8gf9?file=/src/index.js
- Open the dev tools, go to network tab
- BUG: There is no new request to the graphql endpoint even though the
pollingInterval
is set to2000
- If you remove
<React.StrictMode>
inindex.js
file, the polling will work as expected.
Issue Analytics
- State:
- Created a year ago
- Reactions:33
- Comments:20
Top Results From Across the Web
useQuery pollInterval with cache-and-network doesn't stop ...
React Apollo: useQuery pollInterval with cache-and-network doesn't stop to make requests after unmounting the component.
Read more >Queries - Apollo GraphQL Docs
This article shows how to fetch GraphQL data in React with the useQuery hook and ... Note that if you set pollInterval to...
Read more >apollo/client
Make queries with a pollInterval respect the no-cache fetch policy, ... Apollo Client v3.6 should no longer prevent you from updating to React...
Read more >The React + Apollo Tutorial for 2020 (Real-World Examples)
Plus it makes working with React and GraphQL a lot easier by giving us ... graphql-tag is integrated into apollo-boost , but not...
Read more >@apollo/client | Yarn - Package Manager
Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Experiencing this as well. Manually triggering the poll via startPolling is a workaround
@thiagokpelo Mmmm then i dont understand why it doesnt work in my case. I should try a minimal reproduction example. Thanks for telling me!!