Skip to content

Commit

Permalink
fix TS strict
Browse files Browse the repository at this point in the history
For some reason, Ref doesnt break TS strict linter but RefObject does...
  • Loading branch information
LFDanLu committed Dec 20, 2022
1 parent fcc15e5 commit b04f490
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@react-spectrum/actionbar/src/ActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {FocusScope} from '@react-aria/focus';
// @ts-ignore
import intlMessages from '../intl/*.json';
import {OpenTransition} from '@react-spectrum/overlays';
import React, {ReactElement, RefObject, useEffect, useRef} from 'react';
import React, {ReactElement, Ref, useEffect, useRef} from 'react';
import {SpectrumActionBarProps} from '@react-types/actionbar';
import styles from './actionbar.css';
import {Text} from '@react-spectrum/text';
Expand All @@ -48,7 +48,7 @@ interface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {
isOpen?: boolean
}

function ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: RefObject<HTMLDivElement>) {
function ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {
props = useProviderProps(props);

let {
Expand Down Expand Up @@ -128,7 +128,7 @@ function ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: RefObject<HTMLDiv
);
}

const ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(props: SpectrumActionBarProps<T> & {ref?: RefObject<HTMLDivElement>}) => ReturnType<typeof ActionBarInner>;
const ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}) => ReactElement;

/**
* TODO: Add description of component here.
Expand Down

0 comments on commit b04f490

Please sign in to comment.