Skip to content

Commit

Permalink
[@mantine/core] Tabs: Fix keepMounted prop being added as attribute…
Browse files Browse the repository at this point in the history
… to `Tabs.Panel` DOM element (#6711)
  • Loading branch information
Kenzo-Wada authored Aug 26, 2024
1 parent f24ad86 commit 482fa8c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ const defaultProps: Partial<TabsPanelProps> = {};

export const TabsPanel = factory<TabsPanelFactory>((_props, ref) => {
const props = useProps('TabsPanel', defaultProps, _props);
const { children, className, value, classNames, styles, style, mod, ...others } = props;
const { children, className, value, classNames, styles, style, mod, keepMounted, ...others } =
props;

const ctx = useTabsContext();

const active = ctx.value === value;
const content = ctx.keepMounted || props.keepMounted ? children : active ? children : null;
const content = ctx.keepMounted || keepMounted ? children : active ? children : null;

return (
<Box
Expand Down

0 comments on commit 482fa8c

Please sign in to comment.