Skip to content

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Dec 3, 2025

Fixes #8211 - issues with the examples browser after dependency updates.

React 19 Fragment Fix

  • Replaced fragment() calls with div wrappers using display: contents in Example.mjs, MainLayout.mjs, and ErrorBoundary.mjs
  • PCUI's Container component clones children with a parent prop, which React 19 now strictly rejects on Fragments
  • Using display: contents preserves layout behavior while allowing the wrapper to accept arbitrary props

Sidebar Selection Fix

  • Updated SideBar component to use React Router's useLocation hook instead of the native hashchange event
  • React Router v7 navigates via History API without triggering native hash events
  • Created SideBarWithRouter wrapper following the same pattern as ExampleWithRouter

Build Warning Suppression

  • Added onwarn handler to rollup config to suppress "use client" directive warnings from react-router v7
  • These directives are for React Server Components which the examples browser doesn't use

@mvaligursky mvaligursky self-assigned this Dec 3, 2025
@mvaligursky mvaligursky added bug Something isn't working area: examples labels Dec 3, 2025
@mvaligursky mvaligursky requested a review from a team December 3, 2025 10:23
@mvaligursky mvaligursky merged commit 851696e into main Dec 3, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-example-react-fixes branch December 3, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: examples bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with examples after dependencies were updated

3 participants