Skip to content

Commit d503a29

Browse files
authored
update breadcrumbs to handle breadcrumb context overrides (#6920)
1 parent 72b8098 commit d503a29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/@react-spectrum/s2/src/Breadcrumbs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {t
1919
import {forwardRefType} from './types';
2020
import {size, style} from '../style/spectrum-theme' with { type: 'macro' };
2121
import {useDOMRef} from '@react-spectrum/utils';
22+
import {useSpectrumContextProps} from './useSpectrumContextProps';
2223

2324
interface BreadcrumbsStyleProps {
2425
/**
@@ -42,7 +43,7 @@ export interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps<T>, 'chil
4243
children?: ReactNode
4344
}
4445

45-
export const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLDivElement>>>(null);
46+
export const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLOListElement>>>(null);
4647

4748
const wrapper = style<BreadcrumbsStyleProps>({
4849
display: 'flex',
@@ -71,6 +72,7 @@ const wrapper = style<BreadcrumbsStyleProps>({
7172
}, getAllowedOverrides());
7273

7374
function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {
75+
[props, ref] = useSpectrumContextProps(props, ref, BreadcrumbsContext);
7476
let {
7577
UNSAFE_className = '',
7678
UNSAFE_style,

0 commit comments

Comments
 (0)