Repository navigation
Description
Describe the problem
A clear and concise description of the problem. Which components are affected?
When following the Tabs example in https://www.patternfly.org/components/tabs/#default-tabs, inlining the TabTitleText element as a prop in the Tab leads to no microanimation being shown when switching tabs. Memoizing the TabTitleText is required for the microanimation to show
How do you reproduce the problem?
Provide steps to reproduce. A codesandbox demonstrating the problem is appreciated.
AI generated repro: see pf-tabs-react19-repro.zip
import { useEffect, useMemo, useRef, useState } from 'react';
import { Tabs, Tab, TabTitleText } from '@patternfly/react-core';
const TAB_LABELS = ['Overview', 'Details', 'Activity'];
/**
* Case 1 — the idiomatic usage: inline `title` elements.
*
* Every render creates a new <TabTitleText> element, so PatternFly Tab's
* `useEffect(() => setAccentStyles(true), [title, actions])` re-fires on every
* tab switch. On React 19 the effect's state update is flushed in the same
* commit as the tab switch, so `pf-m-initializing-accent`
* (--pf-v6-c-tabs--link-accent--TransitionDuration: 0) is applied together
* with the new underline position and the underline jumps instead of sliding.
*/
function TabsWithInlineTitles() {
const [activeKey, setActiveKey] = useState(TAB_LABELS[0]);
return (
<Tabs activeKey={activeKey} onSelect={(_, tabIndex) => setActiveKey(tabIndex)}>
{TAB_LABELS.map((label) => (
<Tab key={label} eventKey={label} title={<TabTitleText>{label}</TabTitleText>} />
))}
</Tabs>
);
}
/**
* Case 2 — consumer workaround: memoize the title elements so their identity is
* stable while their content is unchanged. The effect does not re-fire and the
* underline transition runs as on React 18.
*/
function TabsWithMemoizedTitles() {
const [activeKey, setActiveKey] = useState(TAB_LABELS[0]);
const titles = useMemo(
() => TAB_LABELS.map((label) => <TabTitleText key={label}>{label}</TabTitleText>),
[],
);
return (
<Tabs activeKey={activeKey} onSelect={(_, tabIndex) => setActiveKey(tabIndex)}>
{titles.map((title, index) => (
<Tab key={TAB_LABELS[index]} eventKey={TAB_LABELS[index]} title={title} />
))}
</Tabs>
);
}
/**
* Renders a tabs demo next to a live log of class/style mutations on the tabs
* root element, so the DOM commit ordering is observable without video.
*/
function Demo({ heading, note, children }) {
const containerRef = useRef(null);
const [entries, setEntries] = useState([]);
useEffect(() => {
const tabsRoot = containerRef.current.querySelector('.pf-v6-c-tabs');
const observer = new MutationObserver((mutations) => {
const stamped = mutations
.filter((m) => m.type === 'attributes')
.map((m) => ({
ts: Math.round(performance.now()),
attr: m.attributeName,
value: m.target.getAttribute(m.attributeName),
}));
if (stamped.length) {
setEntries((prev) => [...prev, ...stamped].slice(-12));
}
});
observer.observe(tabsRoot, { attributes: true, attributeFilter: ['class', 'style'] });
return () => observer.disconnect();
}, []);
return (
<section className="demo">
<h2>{heading}</h2>
<p className="note">{note}</p>
<div ref={containerRef}>{children}</div>
<ul className="event-log">
{entries.length === 0 && <li>click a tab — mutations will appear here</li>}
{entries.map((entry, index) => (
<li key={index}>
{entry.ts}ms <strong>{entry.attr}</strong>:{' '}
<span className={entry.value.includes('initializing-accent') ? 'accent' : ''}>
{entry.value}
</span>
</li>
))}
</ul>
</section>
);
}
export function App() {
return (
<main>
<h1>
PatternFly Tabs: the current-tab underline animation is lost on React 19 when
<code> title </code> is passed as an inline element
</h1>
<p>Click between the tabs in both demos and compare the underline motion.</p>
<div className="demos">
<Demo
heading="1. Inline title elements (broken on React 19)"
note="title={<TabTitleText>…</TabTitleText>} is created on every render — the documented, idiomatic usage. The underline jumps with no transition; watch pf-m-initializing-accent appear in the log together with the accent position change."
>
<TabsWithInlineTitles />
</Demo>
<Demo
heading="2. Memoized title elements (workaround)"
note="The same Tabs/Tab usage, but title elements are memoized so their identity is stable. The underline slides and no pf-m-initializing-accent entry appears on tab switch."
>
<TabsWithMemoizedTitles />
</Demo>
</div>
<footer>
react 19.3.1 · react-dom 19.3.1 · @patternfly/react-core 6.6.2 — on react/react-dom
18.3.1, demo 1 animates as well.
</footer>
</main>
);
}Expected behavior
A clear and concise description of the expected behavior.
Microanimation using the Tabs docs example under React 19
Is this issue blocking you?
List the workaround if there is one.
Not yet
Screenshots
If applicable, add screenshots to help explain the issue.
Screen.Recording.2026-11-19.at.3.14.06.PM.mov
What is your environment?
macOS 27.2 Firefox 160
Activity