c879fce0d4
The image prop `onLoadingComplete()` was unexpectedly called multiple times because it uses a [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs). This could lead to an infinite loop if `onLoadingComplete()` calls `setState()` as demonstrated in the updated test. The solution is to handle refs with `useRef()` and `useEffect` so `onLoadingComplete()` is called at most once per component instance. - Fixes #33463 |
||
---|---|---|
.. | ||
create-next-app | ||
eslint-config-next | ||
eslint-plugin-next | ||
next | ||
next-bundle-analyzer | ||
next-codemod | ||
next-env | ||
next-mdx | ||
next-plugin-storybook | ||
next-polyfill-module | ||
next-polyfill-nomodule | ||
next-swc | ||
react-dev-overlay | ||
react-refresh-utils |