Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

useEvent hook in react18

function Chat() {
  const [text, setText] = useState('');

  const onClick = useEvent(() => {
    sendMessage(text);
  });

  return <SendButton onClick={onClick} />;
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #useEvent #hook
ADD COMMENT
Topic
Name
7+4 =