mirror of
https://github.com/outline/outline.git
synced 2026-01-06 02:59:54 -06:00
22 lines
458 B
TypeScript
22 lines
458 B
TypeScript
import * as React from "react";
|
|
|
|
type Props = {
|
|
children?: React.ReactNode;
|
|
className?: string;
|
|
};
|
|
|
|
const EventBoundary: React.FC<Props> = ({ children, className }: Props) => {
|
|
const handleClick = React.useCallback((event: React.SyntheticEvent) => {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
}, []);
|
|
|
|
return (
|
|
<span onClick={handleClick} className={className}>
|
|
{children}
|
|
</span>
|
|
);
|
|
};
|
|
|
|
export default EventBoundary;
|