update to react 18

We were stuck on react 16.x for a long time but dependencies seem to
have caught up enough that migration is trivial now.
This commit is contained in:
David Lechner
2023-05-17 16:33:47 -05:00
committed by David Lechner
parent ca63d048aa
commit bf4670b25d
66 changed files with 226 additions and 449 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 The Pybricks Authors
// Copyright (c) 2022-2023 The Pybricks Authors
import { Intent } from '@blueprintjs/core';
import React from 'react';
import type { CreateToast } from '../../toasterTypes';
import { useI18n } from './i18n';
const BluetoothNotAvailable: React.VoidFunctionComponent = () => {
const BluetoothNotAvailable: React.FunctionComponent = () => {
const i18n = useI18n();
return (
<>
+1 -1
View File
@@ -6,7 +6,7 @@ import React from 'react';
import type { CreateToast } from '../../toasterTypes';
import { useI18n } from './i18n';
const Disconnected: React.VoidFunctionComponent = () => {
const Disconnected: React.FunctionComponent = () => {
const i18n = useI18n();
return <p>{i18n.translate('disconnected.message')}</p>;
};
+2 -2
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 The Pybricks Authors
// Copyright (c) 2022-2023 The Pybricks Authors
import { Intent } from '@blueprintjs/core';
import React from 'react';
@@ -11,7 +11,7 @@ type MissingServiceProps = {
hubName: string;
};
const MissingService: React.VoidFunctionComponent<MissingServiceProps> = ({
const MissingService: React.FunctionComponent<MissingServiceProps> = ({
serviceName,
hubName,
}) => {
+1 -1
View File
@@ -14,7 +14,7 @@ type NewPybricksProfileProps = {
supportedVersion: string;
};
const NewPybricksProfile: React.VoidFunctionComponent<NewPybricksProfileProps> = ({
const NewPybricksProfile: React.FunctionComponent<NewPybricksProfileProps> = ({
hubVersion,
supportedVersion,
}) => {
+2 -2
View File
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 The Pybricks Authors
// Copyright (c) 2022-2023 The Pybricks Authors
import { Intent } from '@blueprintjs/core';
import React from 'react';
import type { CreateToast } from '../../toasterTypes';
import { useI18n } from './i18n';
const NoGatt: React.VoidFunctionComponent = () => {
const NoGatt: React.FunctionComponent = () => {
const i18n = useI18n();
return <p>{i18n.translate('noGatt.message')}</p>;
};
+2 -2
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 The Pybricks Authors
// Copyright (c) 2022-2023 The Pybricks Authors
import './index.scss';
import { AnchorButton, Button, Intent } from '@blueprintjs/core';
@@ -13,7 +13,7 @@ type NoHubProps = {
onFlashFirmware: () => void;
};
const NoHub: React.VoidFunctionComponent<NoHubProps> = ({ onFlashFirmware }) => {
const NoHub: React.FunctionComponent<NoHubProps> = ({ onFlashFirmware }) => {
const i18n = useI18n();
return (
+2 -2
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 The Pybricks Authors
// Copyright (c) 2022-2023 The Pybricks Authors
import { Button, Code, Intent } from '@blueprintjs/core';
import React from 'react';
@@ -7,7 +7,7 @@ import type { CreateToast } from '../../toasterTypes';
import { isIOS, isLinux } from '../../utils/os';
import { useI18n } from './i18n';
const NoWebBluetooth: React.VoidFunctionComponent = () => {
const NoWebBluetooth: React.FunctionComponent = () => {
const i18n = useI18n();
return (
<>
+2 -2
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 The Pybricks Authors
// Copyright (c) 2022-2023 The Pybricks Authors
import './index.scss';
import { Button, Intent } from '@blueprintjs/core';
@@ -11,7 +11,7 @@ type OldFirmwareProps = {
onFlashFirmware: () => void;
};
const OldFirmware: React.VoidFunctionComponent<OldFirmwareProps> = ({
const OldFirmware: React.FunctionComponent<OldFirmwareProps> = ({
onFlashFirmware,
}) => {
const i18n = useI18n();