MCPcopy Create free account
hub / github.com/szhsin/react-menu / handleCopy

Function handleCopy

example/src/components/Example.js:36–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 const { isDark, theme } = useTheme();
35
36 const handleCopy = async () => {
37 try {
38 await navigator.clipboard.writeText(sourceCode);
39 setToolTip('Copied!');
40 } catch {
41 setToolTip('Something went wrong.');
42 }
43 };
44
45 const getBtnMouseEvents = (anchorRef, tooltip) => ({
46 onMouseEnter() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…