window.location 을 이용해서 페이지이동으로 하려고하니 전체 페이지가 refresh되면서 recoil의 state가 날아가는 현상이 발생 next/router를 이용해서 계속 에러가 발생했는데 next/navigation 의 useRouter를 사용했어야했다. import { useRouter } from 'next/navigation'; export default function Page() { const router = useRouter(); return ( router.push('/dashboard')}> Dashboard ); } Reference https://beta.nextjs.org/docs/api-reference/use-router Client Component Hooks: ..
1. 순수하게 input 만을 이용한 version. without any modules ModalTemp.js -> onChange 를 사용해서 상단으로 넘겨줘서 onSave로 넘긴 데이터 사용. 테스트 onSave(e)} /> 테스트2 onSave(e)} /> index.js -> 자식컴포넌트에서 받아온 data를 내가 저장할때 필요한 data 틀을 useState를 이용해서 만들어서 넣어준다 const [regist, setRegist] = React.useState({ test: '', test2: '' }); const registerHspt = (data) => { setRegist({ ...regist, [e.target.name]: e.target.value, }); . . 2. Modal..
const alphabets = [1,1,1,2,3,3,1,4,5]; const counts = alphabets.reduce((acc, current) => { if(acc[current]){ acc[current] += 1; } else { acc[current] = 1; } return acc; }, {}); console.log(counts); //{ '1': 4, '2': 1, '3': 2, '4': 1, '5': 1 }
child to parent window.opener(): 새 창을 만든 window를 reference window.postMessage(): window간의 cross-origin 통신을 가능하게 함. 메시지를 받을 때는, 윈도우의 ‘message’ 이벤트에 대한 핸들러를 등록하면 된다. window.opener.postMessage({ event: "DIALOG_OPEN" }, _url); window.addEventListener("message", (event) => { switch ((event.data || {}).event) { case "READING_ON": { this.readingOn(); break; } case "READING_OFF" : { this.readingOff(even..
- Total
- Today
- Yesterday
- C++
- hackerrank javascript
- rest parameter
- java
- math.abs
- javascript
- algorithm
- easy javascript algorithm
- equals()
- 프로그래머스 알고리즘
- Javascript Algorithm
- Collection Framework
- compareTo()
- Object type casting
- 프로그래머스
- substring()
- hackerrank javascript solution
- code refactoring
- ... in Javascript
- hackerrank
- spring boot application
- hackerrank solution
- math.max
- 프로그래머스 알고리즘문제
- HackerRank Algorithm
- HashMap
- repeat()
- string class in java
- easy algorithm
- 알고리즘
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |