diff --git "a/18_\352\260\225\354\236\254\354\230\201/react_project/src/index.js" "b/18_\352\260\225\354\236\254\354\230\201/react_project/src/index.js" index 2a22670..bd1f497 100644 --- "a/18_\352\260\225\354\236\254\354\230\201/react_project/src/index.js" +++ "b/18_\352\260\225\354\236\254\354\230\201/react_project/src/index.js" @@ -5,11 +5,12 @@ import App from './App'; import reportWebVitals from './reportWebVitals'; import Project1 from './session08/Project1'; import Login from './session08/Login'; +import Custom_Hook_Login from './session09/Custom_Hook'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - + ); diff --git "a/18_\352\260\225\354\236\254\354\230\201/react_project/src/session09/Custom_Hook.js" "b/18_\352\260\225\354\236\254\354\230\201/react_project/src/session09/Custom_Hook.js" new file mode 100644 index 0000000..35f7b13 --- /dev/null +++ "b/18_\352\260\225\354\236\254\354\230\201/react_project/src/session09/Custom_Hook.js" @@ -0,0 +1,66 @@ +import React,{useState} from "react"; +import styled from "styled-components"; +import Input from "./Input"; + + + +function Custom_Hook_Login() { + const [emailValue, setEmail]=useState('') + const [pwValue, setPw]=useState() + const [textValue, setText]=useState('') + + const submitHandler = (event) => { + event.preventDefault() + console.log(emailValue) + console.log(pwValue) + console.log(textValue) + setEmail(''); + setPw(""); + setText(""); + } + const saveText = event => { + setText(event.target.value); + // console.log(event.target.value); + }; + const saveEmail = event => { + setEmail(event.target.value); + // console.log(event.target.value); + }; + const savePw = event => { + setPw(event.target.value); + // console.log(event.target.value); + }; + + const StyledButton = styled.button` + background-color: green; + color: white; + font-size: 50px; +`; + function Button() { + return ( + Login + ) + } + return ( +
+
+

+ +

+ +

+ +

+

+ +

{textValue}

+

+

{emailValue}

+

+

{pwValue}

+
+
+ ); +} + +export default Custom_Hook_Login; diff --git "a/18_\352\260\225\354\236\254\354\230\201/react_project/src/session09/Input.js" "b/18_\352\260\225\354\236\254\354\230\201/react_project/src/session09/Input.js" new file mode 100644 index 0000000..a3f62af --- /dev/null +++ "b/18_\352\260\225\354\236\254\354\230\201/react_project/src/session09/Input.js" @@ -0,0 +1,16 @@ +import React from "react"; + +const Input =({type, name, value, onChange})=>{ + return ( +
+ +
+ ); +}; + +export default Input; \ No newline at end of file diff --git "a/18_\352\260\225\354\236\254\354\230\201/react_project/src/session09/Signup.js" "b/18_\352\260\225\354\236\254\354\230\201/react_project/src/session09/Signup.js" new file mode 100644 index 0000000..e69de29