react-i18next icon indicating copy to clipboard operation
react-i18next copied to clipboard

A component suspended while responding to synchronous input

Open Nabeel-Mhd opened this issue 1 year ago • 4 comments

So I was using the useTranslation inside a Modal, I got this issue. when I removed those lines of code which corresponds to useTranslation, Modal worked fine.

A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.

const { t, i18n } = useTranslation([ "common"]);

Even above line of code breaks the code.

Nabeel-Mhd avatar Feb 10 '25 15:02 Nabeel-Mhd

Please provide a minimal reproducible example repository.

adrai avatar Feb 10 '25 15:02 adrai

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 26 '25 02:04 stale[bot]

I got this issue within tests using react-testing-library. We did a migration and didn't properly handle the Suspense usage from the newer version. We just disabled the useSuspense option and it worked 👍

See https://react.i18next.com/latest/migrating-v9-to-v10#migration

i18n.init({
  react: {
    useSuspense: false
  }
});

johannchopin-buyco avatar Apr 28 '25 14:04 johannchopin-buyco

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 06 '25 04:05 stale[bot]