- Makes menus fully accessible and keyboard driven - Currently adds 2.8% to initial bundle size due to the inclusion of Reakit and its dependency, popperjs. - Converts all menus to functional components - Remove old custom menu system - Various layout and flow improvements around the menus closes #1766
22 lines
421 B
JavaScript
22 lines
421 B
JavaScript
// @flow
|
|
|
|
import * as React from "react";
|
|
|
|
type Props = {
|
|
children: React.Node,
|
|
className?: string,
|
|
};
|
|
|
|
export default function EventBoundary({ children, className }: Props) {
|
|
const handleClick = React.useCallback((event: SyntheticEvent<>) => {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
}, []);
|
|
|
|
return (
|
|
<span onClick={handleClick} className={className}>
|
|
{children}
|
|
</span>
|
|
);
|
|
}
|