본문 바로가기

분류 전체보기525

[TroubleShooting] react query이용중 에러를 만나다. 영화 오픈api를 이용해서 혼자 솔로프로젝트를 하는중 에러를 마주했다. 근데 아직 더 많이 공부가 필요하다고 생각하는 react query부분이였다. const { data, isLoading } = useQuery( ["hometv", "trending"], getHomeTv );react query를 이용해서 home화면에서 쓰이는 tv 프로그램에 대한 정보는 호출해왔다. 이제 movie에 대한 정보를 가져오려고 코드를 적는중 에러를 마주했다.  const { data2, isLoading2 } = useQuery( ["homemovie", "trending"], getHomeMovies );이렇게 적어도 data2부분을 읽을수없다고 했다. 근데 생각해보니 저기의 data부분.. 2023. 9. 15.
[React] 진짜 미친 Framer motion이다 {!clicked ? : null} {clicked ? : null} 이렇게 하면 따로따로 원래 리액트 하던것처럼 작동하던게 {!clicked ? : null} {clicked ? : null} layoutId를 동일하게 붙이는 순간 둘사이의 이동으로 연결된다 !!! 진짜 Crazy!!!!! Funking Crazy!!!!!!!!!!!!! 완성코드 import { motion, AnimatePresence } from "framer-motion"; import { useState } from "react"; import styled from "styled-components"; const Wrapper = styled(motion.div)` height: 100vh; width: 100vw; displa.. 2023. 9. 11.
[React] MotionValue에서 console.log motionValue가 바뀌면 컴포넌트가 재랜더링되지 않는다. 그래서 console.log 적용안된다. 이렇게 해줘야한다. useEffect(() => { x.onChange(() => console.log(x.get())); }, [x]); 2023. 9. 11.
[React] 다른 board끼리의 움직임 1. 먼저 sourceboard의 복사본을 만들어줘야한다. const sourceBoard = [...allBoards[source.droppableId]] 2. target도 만들자 const destinationBoard = [...allBoards[destination.droppableId]] 3. 지우고 추가하고 하자 sourceBoard.splice(source.index, 1); destinationBoard.splice(destination?.index, 0, draggableId) 4. 모두 출력하자 return { ...allBoards, [source.droppableId]: sourceBoard, [destination.droppableId]: destinationBoard, } 2023. 9. 8.