mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 11:04:49 +00:00
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:
committed by
David Lechner
parent
ca63d048aa
commit
bf4670b25d
@@ -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 (
|
||||
<>
|
||||
|
||||
@@ -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>;
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
}) => {
|
||||
|
||||
@@ -14,7 +14,7 @@ type NewPybricksProfileProps = {
|
||||
supportedVersion: string;
|
||||
};
|
||||
|
||||
const NewPybricksProfile: React.VoidFunctionComponent<NewPybricksProfileProps> = ({
|
||||
const NewPybricksProfile: React.FunctionComponent<NewPybricksProfileProps> = ({
|
||||
hubVersion,
|
||||
supportedVersion,
|
||||
}) => {
|
||||
|
||||
@@ -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>;
|
||||
};
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user