[Perf] Fix memory leak in useDevicePixelRatio

This commit is contained in:
Alexander Zinchuk 2024-09-19 20:43:38 +02:00
parent f503841d36
commit 9ad5cf4909

View File

@ -14,7 +14,7 @@ export default function useDevicePixelRatio() {
const [dpr, setDpr] = useState(window.devicePixelRatio);
useEffectOnce(() => {
callbacks.addCallback(() => {
return callbacks.addCallback(() => {
setDpr(window.devicePixelRatio);
});
});