[Perf] Fix memory leak in useDevicePixelRatio
This commit is contained in:
parent
f503841d36
commit
9ad5cf4909
@ -14,7 +14,7 @@ export default function useDevicePixelRatio() {
|
||||
const [dpr, setDpr] = useState(window.devicePixelRatio);
|
||||
|
||||
useEffectOnce(() => {
|
||||
callbacks.addCallback(() => {
|
||||
return callbacks.addCallback(() => {
|
||||
setDpr(window.devicePixelRatio);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user