Skip to content
Snippets Groups Projects
Commit 1ef255d0 authored by epson220's avatar epson220
Browse files

리액트라우터문제해결시도

parent be228d69
Branches
No related tags found
No related merge requests found
[{"C:\\WYH\\frontend\\src\\reportWebVitals.js":"1","C:\\WYH\\frontend\\src\\App.js":"2","C:\\WYH\\frontend\\src\\index.js":"3","C:\\WYH\\frontend\\src\\Home.js":"4"},{"size":362,"mtime":1606157613272,"results":"5","hashOfConfig":"6"},{"size":689,"mtime":1606240339668,"results":"7","hashOfConfig":"6"},{"size":544,"mtime":1606240034288,"results":"8","hashOfConfig":"6"},{"size":370,"mtime":1606296711314,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"10w9ldj",{"filePath":"12","messages":"13","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\WYH\\frontend\\src\\reportWebVitals.js",[],"C:\\WYH\\frontend\\src\\App.js",["18"],"C:\\WYH\\frontend\\src\\index.js",[],"C:\\WYH\\frontend\\src\\Home.js",["19"],{"ruleId":"20","severity":1,"message":"21","line":1,"column":17,"nodeType":"22","messageId":"23","endLine":1,"endColumn":26},{"ruleId":"20","severity":1,"message":"24","line":2,"column":10,"nodeType":"22","messageId":"23","endLine":2,"endColumn":15},"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","'Route' is defined but never used."]
\ No newline at end of file
[{"C:\\WYH\\frontend\\src\\reportWebVitals.js":"1","C:\\WYH\\frontend\\src\\App.js":"2","C:\\WYH\\frontend\\src\\index.js":"3","C:\\WYH\\frontend\\src\\Home.js":"4","C:\\WYH\\frontend\\src\\Signup.js":"5","C:\\WYH\\frontend\\src\\Login.js":"6","C:\\WYH\\frontend\\src\\Profile.js":"7"},{"size":362,"mtime":1606157613272,"results":"8","hashOfConfig":"9"},{"size":839,"mtime":1606298737123,"results":"10","hashOfConfig":"9"},{"size":544,"mtime":1606240034288,"results":"11","hashOfConfig":"9"},{"size":370,"mtime":1606296711314,"results":"12","hashOfConfig":"9"},{"size":1500,"mtime":1606311498401,"results":"13","hashOfConfig":"9"},{"size":1144,"mtime":1606311424041,"results":"14","hashOfConfig":"9"},{"size":573,"mtime":1606311449946,"results":"15","hashOfConfig":"9"},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"10w9ldj",{"filePath":"18","messages":"19","errorCount":3,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"24","messages":"25","errorCount":1,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"26"},{"filePath":"27","messages":"28","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\WYH\\frontend\\src\\reportWebVitals.js",[],"C:\\WYH\\frontend\\src\\App.js",["31","32","33","34"],"C:\\WYH\\frontend\\src\\index.js",[],"C:\\WYH\\frontend\\src\\Home.js",["35"],"C:\\WYH\\frontend\\src\\Signup.js",["36","37"],"import React, { useState } from \"react\";\r\nimport { post } from \"../../backend/app\";\r\n\r\nconst Signup = () => {\r\n const [username, setUsername] = useState(\"\");\r\n const [nicname, setNicname] = useState(\"\");\r\n const [password, setPassword] = useState(\"\");\r\n\r\n const onChangeUsername = (e) => setUsername(e.target.value);\r\n const onChangeNicname = (e) => setNicname(e.target.value);\r\n const onChangePassword = (e) => setPassword(e.target.value);\r\n\r\n const handleFormSubmit = () => {\r\n const url = \"/signup\";\r\n const formData = new FormData();\r\n formData.append(\"username\", username);\r\n formData.append(\"password\", password);\r\n formData.append(\"nicname\", nicname);\r\n\r\n const config = {\r\n headers: {\r\n \"content-type\": \"multipart/form-data\",\r\n },\r\n };\r\n\r\n return post(url, formData, config);\r\n };\r\n\r\n return (\r\n <form onSubmit={handleFormSubmit}>\r\n <h1>회원가입</h1>\r\n 이메일:\r\n <input\r\n type=\"text\"\r\n name=\"username\"\r\n value={username}\r\n onChange={onChangeUsername}\r\n ></input>\r\n 비밀번호:\r\n <input\r\n type=\"password\"\r\n name=\"password\"\r\n value={password}\r\n onChange={onChangePassword}\r\n ></input>\r\n 닉네임:\r\n <input\r\n type=\"text\"\r\n name=\"nicname\"\r\n value={nicname}\r\n onChange={onChangeNicname}\r\n ></input>\r\n <button type=\"submit\">가입완료</button>\r\n </form>\r\n );\r\n};\r\n\r\nexport default Signup;\r\n","C:\\WYH\\frontend\\src\\Login.js",["38"],"C:\\WYH\\frontend\\src\\Profile.js",[],{"ruleId":"39","severity":1,"message":"40","line":1,"column":17,"nodeType":"41","messageId":"42","endLine":1,"endColumn":26},{"ruleId":"43","severity":2,"message":"44","line":32,"column":39,"nodeType":"41","messageId":"45","endLine":32,"endColumn":44},{"ruleId":"43","severity":2,"message":"46","line":33,"column":40,"nodeType":"41","messageId":"45","endLine":33,"endColumn":46},{"ruleId":"43","severity":2,"message":"47","line":34,"column":41,"nodeType":"41","messageId":"45","endLine":34,"endColumn":48},{"ruleId":"39","severity":1,"message":"48","line":2,"column":10,"nodeType":"41","messageId":"42","endLine":2,"endColumn":15},{"ruleId":"39","severity":1,"message":"49","line":4,"column":7,"nodeType":"41","messageId":"42","endLine":4,"endColumn":13},{"ruleId":"43","severity":2,"message":"50","line":58,"column":16,"nodeType":"41","messageId":"45","endLine":58,"endColumn":22},{"ruleId":"43","severity":2,"message":"51","line":22,"column":12,"nodeType":"41","messageId":"45","endLine":22,"endColumn":16},"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","no-undef","'Login' is not defined.","undef","'Signup' is not defined.","'Profile' is not defined.","'Route' is defined but never used.","'Signup' is assigned a value but never used.","'Singup' is not defined.","'post' is not defined."]
\ No newline at end of file
import React, { Component } from "react";
import { Route } from "react-router-dom";
import Home from "./Home";
import Login from "./Login";
import Signup from "./Signup";
import Profile from "./Profile";
//class App extends Component {
// state = {
......
......@@ -43,3 +43,5 @@ const Login = () => {
</form>
);
};
export default Login;
......@@ -24,3 +24,5 @@ const Profile = (login_info) => {
</div>
);
};
export default Profile;
import React, { useState } from "react";
import { post } from "../../backend/app";
const Singup = () => {
const Signup = () => {
const [username, setUsername] = useState("");
const [nicname, setNicname] = useState("");
const [password, setPassword] = useState("");
......@@ -54,3 +54,5 @@ const Singup = () => {
</form>
);
};
export default Signup;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment