use the newest api navigator.clipboard.writeText to copy stuff into clipboard
npm install copy-data-to-clipboard
#or
yarn add copy-data-to-clipboard
import copy from "copy-data-to-clipboard";
copy("Text");
copy("Text", {
debug: true,
message: "copy error",
});