Bug: Polling does not stop after a component is unmounted
Open
bug
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
## Issue
I'm trying to switch from Apollo Client to Relay, but running into an issue with polling queries. Polling does not stop after the component is unmounted.
Example code:
```
const query = useLazyLoadQuery(
TodoAppQuery.default,
{
userId: "me"
},
{
networkCacheConfig: {
poll: 1_000
}
}
);
```
## Expected behavior
Polling to stop after the component is unmounted.
Bug Repo - https://codesandbox.io/s/happy-hamilton-29f8r0?file=/src/PageTwo.tsx
```
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-relay": "^14.1.0",
"relay-runtime": "^14.1.0"
```
Contributor guide
Assessment
This issue has not been assessed yet.