Skip to content

server-site and client-site content dismatch #818

Answered by NikRoe
stellanw asked this question in Web
Discussion options

You must be logged in to vote

Hi there,

one possible solution is to render the calendar component only on the client and change the import to this:

import dynamic from "next/dynamic";

const Calendar = dynamic(
  () => import("react-calendar"),
  { ssr: false } // This will only import `react-calendar` on the client-side
);

Please see if this already does the trick and let me know otherwise.

Best regards ✌️

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@d-hung-nguyen
Comment options

Answer selected by NikRoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Web
Labels
None yet
3 participants