preactjs / preact

⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
https://preactjs.com
MIT License
36.35k stars 1.93k forks source link

False positive on render loop detection #4381

Closed alexander-entin closed 1 month ago

alexander-entin commented 1 month ago

Describe the bug "Too many re-renders" error shows and the app stops when there is no real issue.

To Reproduce https://stackblitz.com/edit/vitejs-vite-kuwua3?file=src%2Fmain.tsx

Steps to reproduce the behavior:

  1. Click the button 25 times
  2. See error

Expected behavior No error, counter == 25

howlowck commented 1 month ago

RL example of hitting this issue (more common than hitting the same button 25 times) is when there is any controlled text input. After typing 25 characters in the input box, boom error, and the input becomes uncontrolled. Please push a new patch version with #4382 fix. 🙏