Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] React 19 compatibility #605

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e4b2791
Update dependencies
michaldudak Sep 12, 2024
f73b90c
Fix handling render props
michaldudak Sep 12, 2024
61442e7
Diry fixes of other unit tests
michaldudak Sep 12, 2024
a50c971
Dedupe
michaldudak Sep 12, 2024
532b7c7
Add reactVersion utility
michaldudak Sep 13, 2024
18cd409
Fix ref type issues
michaldudak Sep 13, 2024
fba6e6a
Fix other TS errors
michaldudak Sep 13, 2024
8e9cb19
Fix reactVersion
michaldudak Sep 13, 2024
a3468ad
Use React.version
michaldudak Sep 13, 2024
22302ba
Dedupe
michaldudak Sep 13, 2024
a48cf6c
Disable next worker threads
michaldudak Sep 13, 2024
3f47481
Fix Positioner's anchor prop
michaldudak Sep 13, 2024
6e13642
Wrap GA in NoSsr
michaldudak Sep 13, 2024
08c4972
Merge remote-tracking branch 'upstream/master' into react-19-compatib…
michaldudak Sep 17, 2024
a71517d
Dedupe
michaldudak Sep 17, 2024
c1c2f41
Fix TS error
michaldudak Sep 17, 2024
10978a0
Maintain compatibility with React 18
michaldudak Sep 17, 2024
ddb980c
Clean up
michaldudak Sep 17, 2024
7690aad
Refactor useRenderPropForkRef
michaldudak Sep 17, 2024
76e7adb
Reduce the use of ReactElement<any>
michaldudak Sep 17, 2024
3e174c8
Remove the use of ReactElement<any>
michaldudak Sep 17, 2024
9b037d0
Remove @ts-ignore
michaldudak Sep 17, 2024
0544b4e
Deps
michaldudak Sep 18, 2024
75f56af
Merge remote-tracking branch 'upstream/master' into react-19-compatib…
michaldudak Sep 18, 2024
26c88a1
Merge remote-tracking branch 'upstream/master' into react-19-compatib…
michaldudak Sep 20, 2024
e1403e9
getInertValue
michaldudak Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/app/experiments/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ function ReactSpringTransition(props: { open: boolean; children?: React.ReactEle
}, [api, open, mounted, setMounted]);

return mounted ? (
/* @ts-ignore */
<springAnimated.div style={springs} className={classes.springWrapper}>
{children}
</springAnimated.div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/blocks/Demo/DemoSourceCopy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ export namespace DemoSourceCopy {
export interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
onCopied?: () => void;
onError?: (error: unknown) => void;
render?: React.ReactElement;
render?: React.ReactElement<any>;
}
}
4 changes: 2 additions & 2 deletions docs/src/blocks/GoogleAnalytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const GoogleAnalytics = React.memo(function GoogleAnalytics(props: GoogleAnalyti
}
}, []);

const timeout = React.useRef<NodeJS.Timeout>();
const timeout = React.useRef<NodeJS.Timeout>(null);
michaldudak marked this conversation as resolved.
Show resolved Hide resolved

React.useEffect(() => {
// Wait for the title to be updated.
// React fires useEffect twice in dev mode
clearTimeout(timeout.current);
clearTimeout(timeout.current ?? undefined);
timeout.current = setTimeout(() => {
// Remove hash as it's never sent to the server
// https://github.com/vercel/next.js/issues/25202
Expand Down
2 changes: 1 addition & 1 deletion docs/src/design-system/ToggleButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ export const ToggleButtonGroup = React.forwardRef(function ToggleButtonGroup<
);
}) as <Option extends { value: string; label: string }>(
props: ToggleButtonGroupProps<Option> & { ref?: React.Ref<HTMLDivElement> },
) => JSX.Element;
) => React.JSX.Element;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to bring this to the main branch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intend to have everything (except for package.json changes) merged to master.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('<AlertDialog.Backdrop />', () => {
refInstanceof: window.HTMLDivElement,
render: (node) => {
return render(
<AlertDialog.Root open modal={false} animated={false}>
<AlertDialog.Root open animated={false}>
{node}
</AlertDialog.Root>,
);
Expand Down
3 changes: 2 additions & 1 deletion packages/mui-base/src/Checkbox/Root/useCheckboxRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useEnhancedEffect } from '../../utils/useEnhancedEffect';
import { useFieldRootContext } from '../../Field/Root/FieldRootContext';
import { useFieldControlValidation } from '../../Field/Control/useFieldControlValidation';
import { useField } from '../../Field/useField';
import { isReactVersionAtLeast } from '../../utils/reactVersion';

export function useCheckboxRoot(params: UseCheckboxRootParameters): UseCheckboxRootReturnValue {
const {
Expand Down Expand Up @@ -133,7 +134,7 @@ export function useCheckboxRoot(params: UseCheckboxRootParameters): UseCheckboxR
type: 'checkbox',
'aria-hidden': true,
// @ts-ignore
inert: 'use' in React ? true : 'true',
inert: isReactVersionAtLeast(19) ? true : 'true',
onChange(event) {
// Workaround for https://github.com/facebook/react/issues/9023
if (event.nativeEvent.defaultPrevented) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export function useCollapsibleContent(

const [height, setHeight] = React.useState(0);

const latestAnimationNameRef = React.useRef<string | undefined>('none');
const originalTransitionDurationStyleRef = React.useRef<string | undefined>();
const latestAnimationNameRef = React.useRef<string>('none');
const originalTransitionDurationStyleRef = React.useRef<string>(null);

const isTransitioningRef = React.useRef(false);

Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Dialog/Popup/useDialogPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useDialogPopup(parameters: UseDialogPopupParameters): UseDialogP
onOpenChange,
});

const popupRef = React.useRef<HTMLElement | null>(null);
const popupRef = React.useRef<HTMLElement>(null);

const dismiss = useDismiss(context, {
outsidePressEvent: 'mousedown',
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/NoSsr/NoSsr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { NoSsrProps } from './NoSsr.types';
*
* - [NoSsr API](https://base-ui.netlify.app/components/react-no-ssr/#api-reference-NoSsr)
*/
function NoSsr(props: NoSsrProps): JSX.Element {
function NoSsr(props: NoSsrProps): React.JSX.Element {
const { children, defer = false, fallback = null } = props;
const [mountedState, setMountedState] = React.useState(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ export namespace UseNumberFieldRoot {
isScrubbing: boolean;
inputRef: ((instance: HTMLInputElement | null) => void) | null;
scrubHandleRef: React.RefObject<ScrubHandle | null>;
scrubAreaRef: React.RefObject<HTMLSpanElement>;
scrubAreaCursorRef: React.RefObject<HTMLSpanElement>;
scrubAreaRef: React.RefObject<HTMLSpanElement | null>;
scrubAreaCursorRef: React.RefObject<HTMLSpanElement | null>;
}
}
2 changes: 1 addition & 1 deletion packages/mui-base/src/NumberField/Root/useScrub.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export interface ScrubParams {
disabled: boolean;
readOnly: boolean;
value: number | null;
inputRef: React.RefObject<HTMLInputElement>;
inputRef: React.RefObject<HTMLInputElement | null>;
incrementValue: (amount: number, dir: 1 | -1, currentValue?: number | null) => void;
getStepAmount: () => number | undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Popover/Root/PopoverRoot.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface PopoverRootContextValue {
setTriggerElement: (el: Element | null) => void;
positionerElement: HTMLElement | null;
setPositionerElement: (el: HTMLElement | null) => void;
popupRef: React.RefObject<HTMLElement>;
popupRef: React.RefObject<HTMLElement | null>;
delay: number;
closeDelay: number;
delayType: 'rest' | 'hover';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Popover/Root/usePopoverRoot.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ export interface UsePopoverRootReturnValue {
setTriggerElement: React.Dispatch<React.SetStateAction<Element | null>>;
positionerElement: HTMLElement | null;
setPositionerElement: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
popupRef: React.RefObject<HTMLElement>;
popupRef: React.RefObject<HTMLElement | null>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface PreviewCardRootContextValue {
getRootPopupProps: (externalProps?: GenericHTMLProps) => GenericHTMLProps;
floatingRootContext: FloatingRootContext;
transitionStatus: TransitionStatus;
popupRef: React.RefObject<HTMLElement>;
popupRef: React.RefObject<HTMLElement | null>;
}

export type PreviewCardRootOwnerState = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ export interface UsePreviewCardRootReturnValue {
setTriggerElement: React.Dispatch<React.SetStateAction<Element | null>>;
positionerElement: HTMLElement | null;
setPositionerElement: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
popupRef: React.RefObject<HTMLDivElement>;
popupRef: React.RefObject<HTMLDivElement | null>;
}
4 changes: 2 additions & 2 deletions packages/mui-base/src/Slider/Control/useSliderControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function useSliderControl(
const handleRootRef = useForkRef(externalRef, registerSliderControl, controlRef);

// A number that uniquely identifies the current finger in the touch session.
const touchIdRef = React.useRef<number>();
const touchIdRef = React.useRef<number>(null);

const moveCountRef = React.useRef(0);

Expand Down Expand Up @@ -122,7 +122,7 @@ export function useSliderControl(
onValueCommitted(newFingerValue.newValue, nativeEvent);
}

touchIdRef.current = undefined;
touchIdRef.current = null;

// eslint-disable-next-line @typescript-eslint/no-use-before-define
stopListening();
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Slider/Root/SliderRoot.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { FieldRootOwnerState } from '../../Field/Root/FieldRoot.types';

export interface SliderThumbMetadata {
inputId: string;
ref: React.RefObject<HTMLElement>;
inputRef: React.RefObject<HTMLInputElement>;
ref: React.RefObject<HTMLElement | null>;
inputRef: React.RefObject<HTMLInputElement | null>;
}

export type SliderContextValue = Omit<
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Slider/Root/useSliderRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function useSliderRoot(parameters: UseSliderParameters): UseSliderReturnValue {

const isRtl = direction === 'rtl';

const previousIndexRef = React.useRef<number>();
const previousIndexRef = React.useRef<number>(null);
let axis = orientation;
if (isRtl && orientation === 'horizontal') {
axis += '-reverse';
Expand Down
3 changes: 2 additions & 1 deletion packages/mui-base/src/Slider/Thumb/SliderThumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useForkRef } from '../../utils/useForkRef';
import { useSliderContext } from '../Root/SliderProvider';
import { SliderThumbProps } from './SliderThumb.types';
import { useSliderThumb } from './useSliderThumb';
import { isReactVersionAtLeast } from '../../utils/reactVersion';

function defaultRender(
props: React.ComponentPropsWithRef<'span'>,
Expand Down Expand Up @@ -72,7 +73,7 @@ const SliderThumb = React.forwardRef(function SliderThumb(

let renderPropRef = null;
if (typeof render !== 'function') {
renderPropRef = 'use' in React ? (render.props as any).ref : render.ref;
renderPropRef = isReactVersionAtLeast(19) ? (render.props as any).ref : render.ref;
}

const mergedRef = useForkRef(renderPropRef, forwardedRef);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Tabs/Root/useTabsRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useControlled } from '../../utils/useControlled';
export interface TabMetadata {
disabled: boolean;
id: string | undefined;
ref: React.RefObject<HTMLElement>;
ref: React.RefObject<HTMLElement | null>;
}

type IdLookupFunction = (id: any) => string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Tabs/TabsList/TabsListContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
export type TabsListContextValue = {
activateOnFocus: boolean;
getTabElement: (value: any) => HTMLElement | null;
tabsListRef: React.RefObject<HTMLElement>;
tabsListRef: React.RefObject<HTMLElement | null>;
};

export const TabsListContext = React.createContext<TabsListContextValue | undefined>(undefined);
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Tabs/TabsList/useTabsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function useTabsList(parameters: UseTabsListParameters): UseTabsListReturnValue
listOrientation = direction === 'rtl' ? 'horizontal-rtl' : 'horizontal-ltr';
}

const tabsListRef = React.useRef<HTMLElement | null>(null);
const tabsListRef = React.useRef<HTMLElement>(null);
const detectActivationDirection = useActivationDirectionDetector(
value,
orientation,
Expand Down Expand Up @@ -194,7 +194,7 @@ function getInset(tab: HTMLElement, tabsList: HTMLElement) {
function useActivationDirectionDetector(
value: any,
orientation: TabsOrientation,
tabsListRef: React.RefObject<HTMLElement>,
tabsListRef: React.RefObject<HTMLElement | null>,
getTabElement: (tabValue: any) => HTMLElement | null,
): (newValue: any) => TabActivationDirection {
const previousTabEdge = React.useRef<number | null>(null);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Tooltip/Root/TooltipRoot.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface TooltipRootContextValue {
setTriggerElement: (el: Element | null) => void;
positionerElement: HTMLElement | null;
setPositionerElement: (el: HTMLElement | null) => void;
popupRef: React.RefObject<HTMLElement>;
popupRef: React.RefObject<HTMLElement | null>;
delay: number;
closeDelay: number;
delayType: 'rest' | 'hover';
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Tooltip/Root/useTooltipRoot.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ export interface UseTooltipRootReturnValue {
positionerElement: HTMLElement | null;
setTriggerElement: React.Dispatch<React.SetStateAction<Element | null>>;
setPositionerElement: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
popupRef: React.RefObject<HTMLElement>;
popupRef: React.RefObject<HTMLElement | null>;
}
2 changes: 1 addition & 1 deletion packages/mui-base/src/useCompound/useCompound.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ describe('compound components', () => {

function Child() {
const ref = React.useRef<HTMLLIElement>(null);
const { id } = useCompoundItem<string, { ref: React.RefObject<HTMLLIElement> }>(
const { id } = useCompoundItem<string, { ref: React.RefObject<HTMLLIElement | null> }>(
idGenerator,
React.useMemo(() => ({ ref }), []),
);
Expand Down
9 changes: 6 additions & 3 deletions packages/mui-base/src/useCompound/useCompoundParent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ if (process.env.NODE_ENV !== 'production') {
CompoundComponentContext.displayName = 'CompoundComponentContext';
}

export interface UseCompoundParentReturnValue<Key, Subitem extends { ref: React.RefObject<Node> }> {
export interface UseCompoundParentReturnValue<
Key,
Subitem extends { ref: React.RefObject<Node | null> },
> {
/**
* The value for the CompoundComponentContext provider.
*/
Expand All @@ -63,7 +66,7 @@ export interface UseCompoundParentReturnValue<Key, Subitem extends { ref: React.
/**
* Sorts the subitems by their position in the DOM.
*/
function sortSubitems<Key, Subitem extends { ref: React.RefObject<Node> }>(
function sortSubitems<Key, Subitem extends { ref: React.RefObject<Node | null> }>(
subitems: Map<Key, Subitem>,
) {
const subitemsArray = Array.from(subitems.keys()).map((key) => {
Expand Down Expand Up @@ -100,7 +103,7 @@ function sortSubitems<Key, Subitem extends { ref: React.RefObject<Node> }>(
*/
export function useCompoundParent<
Key,
Subitem extends { ref: React.RefObject<Node> },
Subitem extends { ref: React.RefObject<Node | null> },
>(): UseCompoundParentReturnValue<Key, Subitem> {
const [subitems, setSubitems] = React.useState(new Map<Key, Subitem>());
const subitemKeys = React.useRef(new Set<Key>());
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/utils/evaluateRenderProp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function evaluateRenderProp<ElementType extends React.ElementType, OwnerS
render: BaseUIComponentProps<ElementType, OwnerState>['render'],
props: React.HTMLAttributes<any> & React.RefAttributes<any>,
ownerState: OwnerState,
): React.ReactElement {
): React.ReactElement<any> {
return typeof render === 'function'
? render(props, ownerState)
: React.cloneElement(render, { ...mergeReactProps(render.props, props), ref: props.ref });
Expand Down
23 changes: 23 additions & 0 deletions packages/mui-base/src/utils/reactVersion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react';

let version = 17;
michaldudak marked this conversation as resolved.
Show resolved Hide resolved

if ('use' in React) {
version = 19;
}

if ('useId' in React) {
version = 18;
}

export const reactVersion = version;

type SupportedVersions = 17 | 18 | 19;

export function isReactVersion(reactVersionToCheck: SupportedVersions): boolean {
return reactVersion === reactVersionToCheck;
}

export function isReactVersionAtLeast(reactVersionToCheck: SupportedVersions): boolean {
return reactVersion >= reactVersionToCheck;
}
2 changes: 1 addition & 1 deletion packages/mui-base/src/utils/useAnimatedElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTransitionStatus } from './useTransitionStatus';

interface UseAnimatedElementParameters {
open: boolean;
ref: React.RefObject<HTMLElement>;
ref: React.RefObject<HTMLElement | null>;
enabled: boolean;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/utils/useAnimationsFinished.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useEventCallback } from './useEventCallback';
* Executes a function once all animations have finished on the provided element.
* @ignore - internal hook.
*/
export function useAnimationsFinished(ref: React.RefObject<HTMLElement>) {
export function useAnimationsFinished(ref: React.RefObject<HTMLElement | null>) {
const frameRef = React.useRef(-1);

const cancelFrames = useEventCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/utils/useComponentRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function useComponentRenderer<

let resolvedRenderProp:
| ComponentRenderFn<React.HTMLAttributes<any>, OwnerState>
| React.ReactElement;
| React.ReactElement<any>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? mui/material-ui#43402

Suggested change
| React.ReactElement<any>;
| React.ReactElement<unknown>;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really care about the shape of the props here, especially that it's an internal hook and its type shouldn't be publicly visible. To constrain it a bit more, I changed it to Record<string, unknown>


if (typeof renderProp === 'string') {
resolvedRenderProp = defaultRenderFunctions[renderProp];
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/utils/useRenderPropForkRef.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import type { BaseUIComponentProps } from './types';
import { useForkRef } from './useForkRef';
import { isReactVersionAtLeast } from './reactVersion';

/**
* Merges the rendering element's `ref` in addition to the other `ref`s.
Expand All @@ -11,8 +12,7 @@ export function useRenderPropForkRef<ElementType extends React.ElementType, Owne
...refs: Array<React.Ref<any>>
): React.RefCallback<any> | null {
let childRef;
if ('use' in React) {
// React 19
if (isReactVersionAtLeast(19)) {
childRef = typeof render !== 'function' ? render.props.ref : null;
} else {
childRef = typeof render !== 'function' ? render.ref : null;
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/test/conformanceTests/className.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type BaseUiConformanceTestsOptions } from '../describeConformance';
import { throwMissingPropError } from './utils';

export function testClassName(
element: React.ReactElement,
element: React.ReactElement<any>,
getOptions: () => BaseUiConformanceTestsOptions,
) {
describe('prop: className', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { throwMissingPropError } from './utils';
import { type BaseUiConformanceTestsOptions } from '../describeConformance';

export function testPropForwarding(
element: React.ReactElement,
element: React.ReactElement<any>,
getOptions: () => BaseUiConformanceTestsOptions,
) {
const { render, testRenderPropWith: Element = 'div' } = getOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type BaseUiConformanceTestsOptions } from '../describeConformance';
import { throwMissingPropError } from './utils';

async function verifyRef(
element: React.ReactElement,
element: React.ReactElement<any>,
render: BaseUiConformanceTestsOptions['render'],
onRef: (instance: unknown, element: HTMLElement | null) => void,
) {
Expand Down
Loading