Skip to content

Commit bf9bc3d

Browse files
committed
temporary TS fixed to get a build
1 parent b1a10d5 commit bf9bc3d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

packages/react-aria-components/src/Navigation.tsx

+14-5
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,39 @@ import {Orientation} from 'react-aria';
2020
import React, {createContext, ForwardedRef, forwardRef, ReactElement, ReactNode} from 'react';
2121

2222
// TODO: Replace NavigationRenderProps with AriaNavigationProps, once it exists
23-
export interface NavigationProps extends NavigationRenderProps, /* RenderProps<NavigationRenderProps>, */ DOMProps, SlotProps {
23+
export interface NavigationProps extends NavigationRenderProps, RenderProps<NavigationRenderProps>, DOMProps, SlotProps {
2424
/** Whether the navigation is disabled. */
2525
isDisabled?: boolean,
2626
/** Handler that is called when a navigation item is clicked. */
2727
onAction?: (key: Key) => void
2828
}
2929

3030
export interface NavigationRenderProps {
31+
/**
32+
* Whether the navigation is disabled.
33+
* @selector [data-disabled]
34+
*/
35+
isDisabled?: boolean,
3136
/**
3237
* The orientation of the navigation.
3338
* @selector [data-orientation="horizontal | vertical"]
3439
*/
3540
orientation: Orientation
3641
}
3742

38-
export const NavigationContext = createContext<ContextValue<NavigationProps, HTMLUListElement>>(null);
43+
// TODO: HTMLDivElement is the wrong type
44+
export const NavigationContext = createContext<ContextValue<NavigationProps, HTMLDivElement>>(null);
3945

4046
function Navigation(props: NavigationProps, ref: ForwardedRef<HTMLDivElement>) {
4147
[props, ref] = useContextProps(props, ref, NavigationContext);
4248

4349
let renderProps = useRenderProps({
4450
...props,
4551
defaultClassName: 'react-aria-Navigation',
46-
values: {isDisabled: props.isDisabled}
52+
values: {
53+
isDisabled: props.isDisabled,
54+
orientation: props.orientation || 'horizontal'
55+
}
4756
});
4857

4958
let domProps = filterDOMProps(props);
@@ -56,11 +65,11 @@ function Navigation(props: NavigationProps, ref: ForwardedRef<HTMLDivElement>) {
5665
ref={ref}
5766
data-disabled={props.isDisabled || undefined}>
5867
<NavigationContext.Provider value={props}>
59-
<ul
68+
<ol
6069
className="react-aria-NavigationList"
6170
data-orientation={props.orientation || 'horizontal'}>
6271
{renderProps.children}
63-
</ul>
72+
</ol>
6473
</NavigationContext.Provider>
6574
</nav>
6675
);

0 commit comments

Comments
 (0)