mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-22 09:35:08 +02:00
useToastProvider()'s `toast` function is recreated by the provider every time any toast is shown anywhere in the app. useUploadFile listed it as a dependency of `uploadFile`, which is itself a dependency of useCreateBlockNote, so an unrelated toast (e.g. "Link copied!") recreated `uploadFile` and made BlockNote rebuild the whole editor instance, resetting the scroll position to the top of the document. Added useToast, a drop-in wrapper around useToastProvider that keeps `toast`'s identity stable behind a ref, and switched every call site in the app to use it instead of the provider's hook directly.