Skip to content

Commit

Permalink
update breadcrumbs to handle breadcrumb context overrides (adobe#6920)
Browse files Browse the repository at this point in the history
  • Loading branch information
jluyau committed Aug 20, 2024
1 parent 72b8098 commit d503a29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@react-spectrum/s2/src/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {t
import {forwardRefType} from './types';
import {size, style} from '../style/spectrum-theme' with { type: 'macro' };
import {useDOMRef} from '@react-spectrum/utils';
import {useSpectrumContextProps} from './useSpectrumContextProps';

interface BreadcrumbsStyleProps {
/**
Expand All @@ -42,7 +43,7 @@ export interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps<T>, 'chil
children?: ReactNode
}

export const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLDivElement>>>(null);
export const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLOListElement>>>(null);

const wrapper = style<BreadcrumbsStyleProps>({
display: 'flex',
Expand Down Expand Up @@ -71,6 +72,7 @@ const wrapper = style<BreadcrumbsStyleProps>({
}, getAllowedOverrides());

function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {
[props, ref] = useSpectrumContextProps(props, ref, BreadcrumbsContext);
let {
UNSAFE_className = '',
UNSAFE_style,
Expand Down

0 comments on commit d503a29

Please sign in to comment.