Memory leak with react in vite for useInterval when setState is static #16478
Replies: 2 comments 1 reply
-
Start a new pull request in StackBlitz Codeflow. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't think Vite is involved here. If you mean it happens after |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I'm having an issue with a vite deployment and I believe I have a memory leak.
The code used is the following:
If I create a project with e.g.
npm create vite@latest ovp -- --template react-ts
, it will create what it seems like a memory leak when I run it and press thestatic
button:I know I could use
useCallback
withdirection
as a dependency to optimize it. But shouldn't it work without it?I have the issue locally, on vercel but not on stackblitz, so my assumption is that it is a vite issue.
This issue has been causing me a lot of headaches and any help would be greatly appreciated!
Thank you and thank you for vite!
Artur
Reproduction
https://ovp-two.vercel.app/
Steps to reproduce
Example with issue: https://ovp-two.vercel.app/
The memory starts to go up.
Example without issue: https://stackblitz.com/edit/vitejs-vite-ttumna?file=src%2FApp.css,src%2FApp.tsx&terminal=dev
The memory does not start to go up.
System Info
Used Package Manager
npm
Logs
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions