전체 글 87

리액트 / 상태 use state

*영어대사를 입력해주세요 생성(submit)을 눌렀을때 콘솔창에 카운터1 카운터2 누를때마다 숫자가 올라감 const Form = (props) => { const counterState = React.useState(1); const counter = counterState[0]; const setCounter = counterState[1]; console.log("카운터", counter); function handleFormSubmit(event) { event.preventDefault(); console.log("폼 전송됨"); setCounter(counter + 1); } return ( 생성 ); } -이때 자바스크립트 문법으로 빨간글씨를 단축해서 기입 const counterState ..

코딩/리액트 2022.03.25

리액트 / 이벤트 다루기

이벤트 : 이미지에 하트 버튼을 눌렀을때 콘솔창에 찍히기 const MainCard = ({ img }) => { function handleHeartClick() { console.log("하트 눌렀음"); } function handleHeartMouseOver() { console.log("하트 스쳐 지나감"); } return ( 🤍 ); -submit하면 리프레시 되는게 디폴트 const Form = (props) => { function handleFormSubmit(event) { event.preventDefault(); console.log("폼 전송됨"); } return ( 생성 ); }

코딩/리액트 2022.03.25

리액트 / 기초, 컴포넌트, 스타일링

(강의: 인프런 / 만들면서 배우는 리액트 : 기초 / 진유림 - 유료강의입니다.) *기초 이렇게 연결을 시켜줘야함 작성방법 const app = ( 1번째 고양이 가라사대 2번째 고양이 가라사대 ); 이 app이라는 변수안에 나타낼 아이들을 div로 묶어서 기입해야함 const 여기다가그려 = document.querySelector('#app') ReactDOM.render(app, 여기다가그려); *html body 에 div id="app"을 심어줘야 저 queryselector가 구현 *컴포넌트란 반복되는 요소들을 말하고 꼭 대문자로 시작하며 함수로 만들수있다. -이름을 붙이면 안녕이라고 해주는 함수가 있다고 가정 function sayHello(name){ return '안녕 +' + name..

코딩/리액트 2022.03.25

JS / 기초, 변수, 조건문 if

공부한 강의 : https://www.youtube.com/watch?v=zN9YVbieTSQ /오쌤의 니가스터디 (왕초보에게 적합) https://www.youtube.com/watch?v=KF6t61yuPCY / 코딩앙마 (일반 초보에게 적합) https://www.youtube.com/watch?v=OCCpGh4ujb8 / 드림코딩 엘리 (어느정도 지식이 필요) *완전언어가 아니여도 데이터 출력이 가능한 아이들 alert(); 경고창에 값 표현 document.write(); body 내부에 값 표현 console.log(); 콘솔창에 값 표현 Ex) alert('값'); - alert('안녕하세요'); *태그도 문자열로 쓸수있다 document.write(' ); *키워드는 js가 특별한 의미를 ..

웹디자인기능사 실기 / gnb 종류별 제이쿼리

2뎁스 자체만 내려오면 $('.submenu').hide(); $('.nav > li').mouseover(function(){ $('.submenu').stop().slideDown(); }); $('.nav > li').mouseleave(function(){ $('.submenu').stop().slideUp(); }); 선택한 1차메뉴의 2뎁스만 내려오면 $('.submenu').hide(); $('.nav > li').mouseover(function(){ $(this).children('.submenu').stop().slideDown(); }); $('.nav > li').mouseleave(function(){ $(this).children('.submenu').stop().slideUp ..

웹디자인기능사 실기 / 레이어 팝업창

----------------html---------------------- x 모달 레이어 팝업창 ------------------css----------------------- .modal{position: fixed; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 100; display: none;} .modal .modal_inner{width: 800px; height: 600px; background-color: #fff; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); text-align: center;} .modal button{wi..