Breaking: HorizontalOverflowScroller removed, use OverflowScroller
If your app imports HorizontalOverflowScroller from @trackunit/react-components, it no longer compiles after you upgrade to 9.0.0. Use OverflowScroller instead. A migration does the rename for you.
What changed
From @trackunit/react-components 9.0.0, OverflowScroller replaces HorizontalOverflowScroller. It also scrolls vertically (direction="vertical") and a column that is at least 8rem wide shows its scroll arrow on a round chip with a label, such as "Scroll down". The old component, HorizontalOverflowScrollerProps and HorizontalOverflowScrollState are removed.
What you need to do
Run these two commands in your repo after you bump @trackunit/react-components to 9.0.0 or later:
npx nx g @trackunit/migrations:migrate
npx nx g @trackunit/migrations:run-migrations
The migration is @trackunit/react-components:v9-0-0-horizontaloverflowscroller-to-overflowscroller. It:
- renames the component and its two types in imports, JSX and type references
- adds
direction="horizontal"to each migrated element, after the other props, so it still wins over a spread - keeps import aliases and does not touch files that do not import from
@trackunit/react-components
// before
import { HorizontalOverflowScroller } from "@trackunit/react-components";
<HorizontalOverflowScroller className="w-full">{children}</HorizontalOverflowScroller>;
// after
import { OverflowScroller } from "@trackunit/react-components";
<OverflowScroller className="w-full" direction="horizontal">{children}</OverflowScroller>;
OverflowScroller defaults to direction="horizontal", so you can drop the prop if you like.
Also good to know
- The CSS variable
--hos-surfacestill works as a fallback. Prefer--os-surface. - The scroll-button labels use new translation keys (
overflowScroller.*). - In right-to-left layouts the fade and paging now mirror, and with
prefers-reduced-motionpaging no longer animates.
For the complete update process, see Maintaining Your Application.