replace use of deprecated IRef

This commit is contained in:
David Lechner
2022-09-01 11:45:59 -05:00
parent d8453afa25
commit b4e1c8293d
3 changed files with 5 additions and 13 deletions
+2 -9
View File
@@ -1,14 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2020-2022 The Pybricks Authors
import {
Button,
IRef,
Intent,
Spinner,
SpinnerSize,
useHotkeys,
} from '@blueprintjs/core';
import { Button, Intent, Spinner, SpinnerSize, useHotkeys } from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
import React, { useEffect, useMemo, useState } from 'react';
import { tooltipDelay } from '../app/constants';
@@ -100,7 +93,7 @@ const ActionButton: React.VoidFunctionComponent<ActionButtonProps> = ({
<Button
id={id}
aria-label={label}
elementRef={tooltipTargetRef as IRef<HTMLButtonElement>}
elementRef={tooltipTargetRef as React.Ref<HTMLButtonElement>}
{...tooltipTargetProps}
// https://github.com/palantir/blueprint/pull/5300
aria-haspopup={undefined}
+2 -2
View File
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2020-2022 The Pybricks Authors
import { Button, IRef, Intent, Spinner, SpinnerSize } from '@blueprintjs/core';
import { Button, Intent, Spinner, SpinnerSize } from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
import React, { useEffect, useState } from 'react';
import { useDropzone } from 'react-dropzone';
@@ -116,7 +116,7 @@ const OpenFileButton: React.VoidFunctionComponent<OpenFileButtonProps> = ({
id,
'aria-label': label,
refKey: 'elementRef',
elementRef: tooltipTargetRef as IRef<HTMLButtonElement>,
elementRef: tooltipTargetRef as React.Ref<HTMLButtonElement>,
...tooltipTargetProps,
// https://github.com/palantir/blueprint/pull/5300
'aria-haspopup': undefined,