cms
cms copied to clipboard
fix: resolve unresponsive Go Back Home button on 404 page in production
PR Fixes:
- Fixed unresponsive "Go Back Home" button on 404 page in production environments
- Resolved hydration mismatch issues caused by complex Button + asChild component chain
- Replaced Radix UI Button component with direct Link to eliminate client-server rendering inconsistencies
- Maintained identical visual styling and user experience while improving reliability
Root Cause: The original implementation used <Button asChild><Link href="/"> which created a complex component chain (Button → Slot → Link) that caused hydration mismatches in production. The server-rendered HTML differed from client-side React rendering, preventing proper event handler attachment.
Solution: Simplified the component structure by using a direct <Link> element with inline button styling classes, eliminating the hydration-prone component composition while preserving the exact same appearance and functionality.
Technical Details:
- Removed dependency on
@radix-ui/react-slotfor this component - Applied button variant classes directly to Link component
- Ensured consistent server-side and client-side rendering
- No breaking changes to existing functionality or visual design
Resolves #1868
Checklist before requesting a review
- [x] I have performed a self-review of my code
- [x] I assure there is no similar/duplicate pull request regarding same issue