Skip to content

fix: use hasMounted to render calcom versionm#6239

Merged
PeerRich merged 9 commits intomainfrom
fix/hydration-err-event-types
Jan 2, 2023
Merged

fix: use hasMounted to render calcom versionm#6239
PeerRich merged 9 commits intomainfrom
fix/hydration-err-event-types

Conversation

@Udit-takkar
Copy link
Copy Markdown
Contributor

@Udit-takkar Udit-takkar commented Jan 2, 2023

What does this PR do?

Fixes Hydration error in /event-types page

Ref: https://www.joshwcomeau.com/react/the-perils-of-rehydration/#the-solution

Environment: Staging(main branch) / Production

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Jan 2, 2023 at 7:38PM (UTC)

@PeerRich
Copy link
Copy Markdown
Member

PeerRich commented Jan 2, 2023

i bet there is a better workaround. if not we should move this into a standalone component to prevent repeating code

@PeerRich
Copy link
Copy Markdown
Member

PeerRich commented Jan 2, 2023

i think by turning the constant into a react component, it would not have hydration issues. wanna try that?

@PeerRich
Copy link
Copy Markdown
Member

PeerRich commented Jan 2, 2023

export default function Credits() {
const CalComVersion = `v.${pkg.version}-${
  process.env.NEXT_PUBLIC_WEBSITE_URL === "https://cal.com" ? "h" : "sh"
}-${process.env.CALCOM_LICENSE_KEY === "" ? "ee" : "ce"}`;

 return <small className="mx-3 mt-1 mb-2 hidden text-[0.5rem] opacity-50 lg:block">
            &copy; {new Date().getFullYear()} {COMPANY_NAME} {CalComVersion}
 </small>
}

Copy link
Copy Markdown
Member

@PeerRich PeerRich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets turn this into a component <Credits>

#6239 (comment)

Copy link
Copy Markdown
Member

@PeerRich PeerRich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made some changes, created <Credits>

@PeerRich
Copy link
Copy Markdown
Member

PeerRich commented Jan 2, 2023

@Udit-takkar can you investigate why checks are failing?

Comment thread apps/web/pages/_app.tsx
@PeerRich PeerRich added ♻️ autoupdate tells kodiak to keep this branch up-to-date automerge labels Jan 2, 2023
@github-actions github-actions Bot removed ♻️ autoupdate tells kodiak to keep this branch up-to-date automerge labels Jan 2, 2023
@PeerRich PeerRich merged commit 8302990 into main Jan 2, 2023
@PeerRich PeerRich deleted the fix/hydration-err-event-types branch January 2, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants