Skip to content

fix: resolve hydration mismatches on initial load#1161

Open
aspartic-gthb wants to merge 1 commit into
magic-peach:mainfrom
aspartic-gthb:fix/hydration-mismatches
Open

fix: resolve hydration mismatches on initial load#1161
aspartic-gthb wants to merge 1 commit into
magic-peach:mainfrom
aspartic-gthb:fix/hydration-mismatches

Conversation

@aspartic-gthb
Copy link
Copy Markdown

@aspartic-gthb aspartic-gthb commented May 25, 2026

Description

This PR resolves two hydration mismatches that occur on the initial page load, and fixes a failing test in the suite:

  • Added a mounted state to ThemeToggle to render a neutral placeholder during SSR, preventing aria-label attribute mismatch.
  • Added suppressHydrationWarning to the FileUpload DropZone to handle third-party browser extensions (like FormDin) that inject the fdprocessedid attribute.
  • Added a localStorage mock polyfill in vitest.setup.ts to fix the TypeError: localStorage.clear is not a function error in the ThemeToggle.test.tsx test.

Related Issue

Fixes #1154

Type of Contribution

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • GSSoC contribution

Participant Info

Checklist

  • I have read the contribution guidelines
  • My changes follow the project structure
  • I have tested my changes in Chrome, Firefox, and Safari
  • bun run lint passes (no ESLint errors)
  • bunx tsc --noEmit passes (no TypeScript errors)
  • New interactive elements have aria-label / accessible names
  • No console.log statements left in
  • This PR is related to a valid issue
  • Screen recording attached above

- Added mounted state to ThemeToggle to render placeholder during SSR

- Added suppressHydrationWarning to FileUpload DropZone for extension injections

- Added localStorage polyfill in vitest.setup.ts to fix failing test suite
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

@aspartic-gthb is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @aspartic-gthb!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

✅ PR Format Check Passed — @aspartic-gthb

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions github-actions Bot added level:beginner Beginner level - 20 pts type:bug Bug fix type:docs Documentation type:feature New feature type:refactor Code refactor type:testing Testing gssoc'26 GirlScript Summer of Code 2026 labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc'26 GirlScript Summer of Code 2026 level:beginner Beginner level - 20 pts type:bug Bug fix type:docs Documentation type:feature New feature type:refactor Code refactor type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Hydration mismatch in ThemeToggle and FileUpload components causing SSR/client mismatch

1 participant