분류 전체보기
-
prettier 설정React.js 2023. 1. 10. 16:35
.prettierrc { "trailingComma": "all", "tabWidth": 2, "useTabs": true, "semi": true, "singleQuote": true, "importOrder": [ "", "^@/components/(.*)$", "^@/screens/(.*)$", "^@/ui/(.*)$", "^@/hooks/(.*)$", "^@/shared/(.*)$", "^@/services/(.*)$", "^@/assets/(.*)$", "^@/utils/(.*)$", "^@/config/(.*)$", "^@/store/(.*)$", "^../(.*)", "^./(.*)", "(.scss)$" ], "importOrderSeparation": true, "importOrderSo..
-
참고자료Html,CSS 2023. 1. 7. 13:44
https://uiverse.io/ Open-Source UI elements - made with CSS and HTML Library of free and customizable HTML and CSS UI elements. It's all open-source, and it's all free. Try it out to save you many hours spent on building & customizing UI components for your next project. uiverse.io
-
react-query에서 만약 리스트 추가 했을때 리스트 갱신 하기React.js/React-Query 2022. 12. 29. 18:00
보통 이럴 경우에는 2가지 방법이 있는데 1. get을 한번 더 해서 리스트를 초기화한다. 2. useState를 활용, 기존 Array에 push 해서 setState를 해준다. const queryClient = useQueryClient(); const [userId, setUserId] = useState(5); // Query const { isLoading, data, isError } = useQuery('users', getUserWithAxios, { staleTime: 5000, }); const mutation = useMutation((data: User) => axios.post('http://localhost:8000/user', data), { onMutate: (data: U..
-
axios 비동기 함수 호출할때 Promise 리턴 받을때카테고리 없음 2022. 12. 27. 15:31
axios 비동기 함수 호출할때 반드시 await 붙여서 해야됨 아님 return 받은 데이터 primise로 받음 export const refreshToken = async() =>{ const response = await apiClient.get(`/users/refreshtoken`); //console.log(response.data); return response.data; } const data = refreshToken(); console.log(data); -> 결과 Promise const data = await refreshToken()으로 받아야됨 또는 then으로 받기
-
Nextjs에서 Nestjs로 accessToken header로 요청할때 오류Next.js 2022. 12. 26. 18:46
Unhandled Runtime Error AxiosError: Network Error has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response accessToken을 헤더로 전송할때 또 오류가 났다. //NextJs export const AuthApiClient = axios.create({ baseURL: "http://localhost:3001", withCredentials: true, headers: { 'Content-type': 'application/json', 'Authorization': 'Bear..
-
Nextjs, Nestjs 쿠키 값 전달시 CORS 오류 쿠키 response request 안됨.Nest.js 2022. 12. 26. 10:54
Access to XMLHttpRequest at 'http://localhost:3001/users/signin' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the ..
-
Recoil, react-query 로그인 오류Next.js 2022. 12. 24. 22:02
로그인 기능을 구현 하고 있는데, 오류가 난다. Violation: Duplicate atom key "loginState". This is a FATAL ERROR in production. But it is safe to ignore this warning if it occurred because of hot module replacement 서칭 해보니 나오는 스택오버플로우 https://stackoverflow.com/questions/71291122/how-can-i-write-update-localstorage-object-in-recoil-atom How can i write(=update) Localstorage object in Recoil Atom? I try to get LocalSt..