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
@@ -11,7 +11,7 @@ afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
const TestToolbar: React.VoidFunctionComponent = () => {
|
||||
const TestToolbar: React.FunctionComponent = () => {
|
||||
return (
|
||||
<Toolbar
|
||||
className="test-class"
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user