rsnext/packages/next/client
Steven c879fce0d4
Fix multiple calls to image onLoadingComplete() (#33474)
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
2022-01-20 15:29:34 +00:00
..
dev improve full refresh overlay (#33301) 2022-01-14 12:32:01 +00:00
portal Use SWC to compile Next.js core server files (#27167) 2021-07-14 18:12:04 +00:00
rsc Escape from next head in rsc _error page (#32624) 2021-12-21 19:24:57 +00:00
head-manager.ts correctly assess node equality when nonce attribute is present (#27573) 2021-11-10 19:31:32 -06:00
image.tsx Fix multiple calls to image onLoadingComplete() (#33474) 2022-01-20 15:29:34 +00:00
index.tsx Pre-compile more dependencies (#32742) 2022-01-17 15:17:22 +00:00
link.tsx fix(Link): Do not ignore onMouseEnter prop with absolute href (#32012) 2021-12-01 18:32:27 +00:00
next-dev.js Remove noop import (#31722) 2021-11-24 15:40:58 +01:00
next.js Use SWC to compile Next.js core server files (#27167) 2021-07-14 18:12:04 +00:00
normalize-trailing-slash.ts fix basepath trailing slash (#15200) 2020-07-15 23:53:31 +00:00
page-loader.ts Fix RSC link navigation (#32303) 2021-12-09 14:45:22 +01:00
performance-relayer.ts Experimental: hook version of reportWebVitals (#28769) 2021-09-24 18:35:33 +00:00
request-idle-callback.ts upgrade to typescript 4.4.3 (#29112) 2021-09-16 18:06:57 +02:00
route-announcer.tsx Give priority to document.title over h1 when announcing page change (#31147) 2021-11-08 14:58:21 +00:00
route-loader.ts Improve and refactor some types (#31704) 2021-11-25 10:46:00 +01:00
router.ts Custom app for server components (#33149) 2022-01-14 13:01:00 +00:00
script.tsx next/script fix duplicate scripts (#28428) 2021-08-24 11:07:38 -05:00
use-intersection.tsx fix(link): cancel idle callback on unmount (#22072) 2021-02-11 13:51:41 -05:00
vitals.ts Rename experimental vital hook (#32343) 2021-12-12 21:14:12 +01:00
with-router.tsx Update to latest babel versions (#28174) 2021-08-17 09:18:08 +02:00