Skip to content

Commit

Permalink
[fix:#2475] docs: convert useDebounceEvent stories file to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
ahammadabdullah committed Oct 13, 2024
1 parent 63c3f29 commit 01a67b2
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
import React, { useCallback, useRef, RefObject, MouseEvent, KeyboardEvent } from "react";
import React, { useCallback, useRef } from "react";
import useClickableProps from "../useClickableProps";
import "./useClickableProps.stories.scss";

interface ClickableProps extends React.HTMLAttributes<HTMLElement> {
onClick: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;
id: string;
"aria-hidden": boolean;
"aria-haspopup": boolean;
"aria-expanded": boolean;
}

export default {
title: "Hooks/useClickableProps"
};

export const Overview = {
render: () => {
const ref: RefObject<HTMLDivElement> = useRef(null);
const ref = useRef(null);
const onClick = useCallback(() => alert("click!"), []);

const clickableProps: ClickableProps = useClickableProps(
const clickableProps = useClickableProps(
{
onClick: onClick,
id: "clickable-id",
Expand All @@ -31,7 +23,7 @@ export const Overview = {
);

return (
<div {...clickableProps} className="monday-storybook-use-clickable-props" ref={ref}>
<div {...clickableProps} className="monday-storybook-use-clickable-props">
I act like a button
</div>
);
Expand Down

0 comments on commit 01a67b2

Please sign in to comment.