diff --git a/src/Note.tsx b/src/Note.tsx index 74759b1..078c2f4 100644 --- a/src/Note.tsx +++ b/src/Note.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { View, useEventHandler, Text, Button } from "@nodegui/react-nodegui"; -import { QPushButtonEvents, NativeEvent } from "@nodegui/nodegui"; +import { View, Text, Button } from "@nodegui/react-nodegui"; +import { QPushButtonEvents } from "@nodegui/nodegui"; export type NoteType = { id: number; @@ -8,25 +8,19 @@ export type NoteType = { text: string; }; -const Note: React.FC<{ note: NoteType; onRemove: (id: number) => void }> = ({ - note, - onRemove -}) => { - const deleteHandler = useEventHandler( - { - [QPushButtonEvents.clicked]: () => { - console.log("removing note id ", note.id); - onRemove(note.id); - } - }, - [onRemove] - ); - +const Note: React.FC<{ + note: NoteType; + onRemove: (id: number) => () => void; +}> = ({ note, onRemove }) => { return ( {note.createdAt.toDateString()} -