Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hydration-related errors occur when Suspense and React.lazy are used in Next.js. #7463

Open
5 of 6 tasks
Jungho-Cheon opened this issue Apr 12, 2024 · 0 comments
Open
5 of 6 tasks
Labels

Comments

@Jungho-Cheon
Copy link

Jungho-Cheon commented Apr 12, 2024

Check that this is really a bug

  • I confirm

Reproduction link

codesandbox

Bug description

When I rendered the components that are dynamically imported through React.lazy inside Swiper or SwiperSlide, the following error occurred.

스크린샷 2024-04-12 오후 3 46 37

I don't know the internal code in detail, but when I looked at it, it is assumed that the cleanup function of useLayoutEffect is executed, causing re-rendering, and an unintended error occurred as the cloneElement is executed.

Expected Behavior

It should be rendered the same, with no exceptions to dynamic import components.

Actual Behavior

No response

Swiper version

11.1.1

Platform/Target and Browser Versions

macOS chome 123.0.6312.107

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@Jungho-Cheon Jungho-Cheon changed the title Hydration-related errors occur when Suspense and React.laze are used internally during SSR. Hydration-related errors occur when Suspense and React.lazy are used in Next.js. Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant