You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
useCombobox appears to be incompatible with react compiler #1646
I have tried to take a look with Downshift installed locally. Adding the new lint rule threw up some warnings:
/Users/matthewbalaam/downshift/src/hooks/useCombobox/index.js
96:5 warning React Hook useEffect has a missing dependency: 'props'. Either include it or remove the dependency array react-hooks/exhaustive-deps
117:4 warning React Hook useMemo has unnecessary dependencies: 'inputRef.current', 'menuRef.current', and 'toggleButtonRef.current'. Either exclude them or remove the dependency array. Mutable values like 'menuRef.current' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
/Users/matthewbalaam/downshift/src/hooks/useSelect/index.js
136:7 warning React Hook useMemo has unnecessary dependencies: 'menuRef.current' and 'toggleButtonRef.current'. Either exclude them or remove the dependency array. Mutable values like 'menuRef.current' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
✖ 3 problems (0 errors, 3 warnings)
Reacted by tangye, Brian Walendzinski and Lenz Weber-Tronic
Yeah, I just updated downshift a few majors, and it has actually gotten a lot worse :/
The pattern of const latestState = latest.current.state to keep functions like getInputProps stable references means that the compiler will never re-execute getInputProps - because it assumes that it will be side-effect free.
Right now, downshift is violating the rules of React left and right :/
That means the component will never see any new state on re-execution.
I would like to offer a PR to get this Compiler-compatible, but it would mean ripping quite a lot of stuff out. Would you be willing to accept such a PR?
Activity
MattyBalaam commentedon May 8, 2025
Screen.Recording.2025-05-08.at.08.52.55.mov
silviuaavram commentedon Jun 2, 2025
Hey @MattyBalaam I'm not aware of the react compiler, can your provide more info and maybe suggest improvements? Thanks!
MattyBalaam commentedon Jun 2, 2025
It is the “auto memo” feature React has been building for a few years and is now in RC: https://react.dev/blog/2025/04/21/react-compiler-rc
You can see it in use on the linked minimal reproduction
MattyBalaam commentedon Jun 3, 2025
I have tried to take a look with Downshift installed locally. Adding the new lint rule threw up some warnings:
phryneas commentedon Jun 3, 2026
Yeah, I just updated downshift a few majors, and it has actually gotten a lot worse :/
The pattern of
const latestState = latest.current.stateto keep functions likegetInputPropsstable references means that the compiler will never re-executegetInputProps- because it assumes that it will be side-effect free.Right now, downshift is violating the rules of React left and right :/
That means the component will never see any new state on re-execution.
I would like to offer a PR to get this Compiler-compatible, but it would mean ripping quite a lot of stuff out. Would you be willing to accept such a PR?
silviuaavram commentedon Jun 30, 2026
fixed by #1690