react-helmet-async icon indicating copy to clipboard operation
react-helmet-async copied to clipboard

HelmetDispatcher leaks when used in combination with Suspense

Open satoren opened this issue 1 year ago • 4 comments

If Suspense occurs after render, componentWillUnmount is not called. Therefore, instances added below will not be removed and will leak. https://github.com/staylor/react-helmet-async/blob/5f4da3896c8b70bedcd3c05d406ff5241601933c/src/Dispatcher.tsx#L71

Also, it will not be updated properly.

https://react.dev/reference/react/Component#componentdidmount

Reference Articles (This is not my post.)

https://zenn.dev/mtblue81/articles/f88821a3c3392e https://mtblue81.github.io/react-helmet-sample/

satoren avatar May 21 '24 03:05 satoren