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
+1 -1
View File
@@ -11,7 +11,7 @@ afterEach(() => {
cleanup();
});
const TestToolbar: React.VoidFunctionComponent = () => {
const TestToolbar: React.FunctionComponent = () => {
return (
<Toolbar
className="test-class"
+5 -3
View File
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 The Pybricks Authors
// Copyright (c) 2022-2023 The Pybricks Authors
import React from 'react';
import React, { PropsWithChildren } from 'react';
import { FocusScope } from 'react-aria';
import { useToolbar } from './aria';
import { ToolbarStateContext, useToolbarState } from './state';
@@ -22,7 +22,9 @@ type ToolbarProps = Pick<
*
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/toolbar_role
*/
export const Toolbar: React.FunctionComponent<ToolbarProps> = (props) => {
export const Toolbar: React.FunctionComponent<PropsWithChildren<ToolbarProps>> = (
props,
) => {
const { className, children } = props;
const state = useToolbarState(props);
const { toolbarProps } = useToolbar(props);