Skip to content
Snippets Groups Projects
Commit bf496ba3 authored by Min Dong Hyeun's avatar Min Dong Hyeun
Browse files

[EDIT]오류 수정

parent a10e4da0
No related branches found
No related tags found
No related merge requests found
......@@ -2,4 +2,3 @@
# Ignore node_modules directory
node_modules/
package.json/
......@@ -19,7 +19,7 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"start": "export PORT=80 && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
......
......@@ -11,15 +11,14 @@ function LinkPageForm() {
const {id} = location.state;
const copyToClipboard = () => {
const textToCopy = `localhost:3000/HomeParticipate/${id}`;
const tempInput = document.createElement('input');
document.body.appendChild(tempInput);
tempInput.value = textToCopy;
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
alert('클립보드에 복사되었습니다');
const copyToClipboard = async (link) => {
try {
const textToCopy = `https://when-meet.link/HomeParticipate/${id}`;
await navigator.clipboard.writeText(textToCopy);
alert('클립보드에 복사되었습니다');
} catch (err) {
alert('클립보드 복사에 실패하였습니다');
}
};
const handleSubmit = async(event) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment