mirror of
https://github.com/outline/outline.git
synced 2026-06-22 07:44:23 +03:00
80d74c9334
closes #1642
17 lines
344 B
JavaScript
17 lines
344 B
JavaScript
// @flow
|
|
|
|
import * as React from "react";
|
|
|
|
type Props = {
|
|
children: React.Node,
|
|
};
|
|
|
|
export default function EventBoundary({ children }: Props) {
|
|
const handleClick = React.useCallback((event: SyntheticEvent<>) => {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
}, []);
|
|
|
|
return <span onClick={handleClick}>{children}</span>;
|
|
}
|