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
+3 -3
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2020-2022 The Pybricks Authors
// Copyright (c) 2020-2023 The Pybricks Authors
import 'react-splitter-layout/lib/index.css';
import './app.scss';
@@ -46,7 +46,7 @@ const Terminal = React.lazy(async () => {
return componentModule;
});
const Docs: React.VFC = () => {
const Docs: React.FunctionComponent = () => {
const { setIsSettingShowDocsEnabled } = useSettingIsShowDocsEnabled();
const { initialDocsPage, setLastDocsPage } = useAppLastDocsPageSetting();
@@ -153,7 +153,7 @@ const Docs: React.VFC = () => {
);
};
const App: React.VFC = () => {
const App: React.FunctionComponent = () => {
const i18n = useI18n();
const { isDarkMode } = useTernaryDarkMode();
const { isSettingShowDocsEnabled } = useSettingIsShowDocsEnabled();
+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 UpdateServerFailure: React.VoidFunctionComponent = () => {
const UpdateServerFailure: React.FunctionComponent = () => {
const i18n = useI18n();
return <p>{i18n.translate('updateServerFailure.message')}</p>;
};