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..
1. simple way using destructuring const AdminProductDetail = () => { const params = useParams(); const navigate = useNavigate(); const [product, setProduct] = useState({ name: '', price: 0, image: '', brand: '', category: '', countInStock: 0, description: '', }); const getData = async (id) => { try { const { data } = await axios.get(`/api/products/${id}`); const { name, price, image, brand, cate..
How does React.js work - React uses JavaScript to creates all the elements you write and pushes them to HTML. - Virtual DOM is used. It's a fast and lightweight copy. Component in React.js - Component is parts of reusable and independent code in React.js. - It does serve like JavaScript functions, but it returns HTML. - When you create React app or show data from React, you deal with Component t..
- Total
- Today
- Yesterday
- HashMap
- javascript
- equals()
- hackerrank javascript
- HackerRank Algorithm
- compareTo()
- hackerrank solution
- hackerrank javascript solution
- 프로그래머스 알고리즘문제
- java
- rest parameter
- spring boot application
- Object type casting
- 프로그래머스 알고리즘
- ... in Javascript
- code refactoring
- 프로그래머스
- C++
- Javascript Algorithm
- substring()
- algorithm
- hackerrank
- string class in java
- math.abs
- 알고리즘
- easy algorithm
- easy javascript algorithm
- math.max
- repeat()
- Collection Framework
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |