index.tsx180 chars8 lines
This code uses the Clipboard API to read the text in the user's clipboard and returns a promise. If the promise resolves successfully, an alert is displayed with the clipboard text. If it fails, an error message will be logged to the console. Note that this is an asynchronous method, so it will not block the execution of other code.
gistlibby LogSnag