묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스
마우스이벤트 형식이 제네릭이아닙니다 오류 해결 못하고 있습니다 어떤 거 인지 알 수 잇을까여?
import { ChangeEvent, useState } from "react"; // 리팩토링 const Board = () => { const [writer, setWriter] = useState(""); const [title, setTitle] = useState(""); const [content, setContent] = useState(""); const [isActive, setIsActive] = useState(false); const onChangewriter = (event:ChangeEvent<HTMLInputElement>) => { setWriter(event.target.value); if (event.target.value !== "" && title && content) return setIsActive(true); setIsActive(false); }; const onChangeTitile = (event:ChangeEvent<HTMLInputElement>) => { setTitle(event.target.value); if (writer && event.target.value && content) return setIsActive(true); setIsActive(false); }; const onChangeContent = (event:ChangeEvent<HTMLInputElement>) => { setContent(event.target.value); if (writer && title && event.target.value) return setIsActive(true) setIsActive(false); }; const onClickSubmit = (event:MouseEvent<HTMLButtonElement>) => [ console.log(writer), console.log(title), console.log(content), alert("게시물 등록이 완료되었습니다"), ]; return ( <> 작성자 : <input type="text" onChange={onChangewriter} /> <br /> 제목 : <input type="text" onChange={onChangeTitile} /> <br /> 내용: <input type="text" onChange={onChangeContent} /> <br /> <button onClick={onClickSubmit} style={{ backgroundColor: isActive === true ? "yellow" : "none" }} > 등록 </button> </> ); }; export default Board;
-
해결됨[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스
마우스이벤트 형식이 제네릭이아닙니다 오류 해결 못하고 있습니다 어떤 거 인지 알 수 잇을까여?
import { ChangeEvent, useState } from "react"; // 리팩토링 const Board = () => { const [writer, setWriter] = useState(""); const [title, setTitle] = useState(""); const [content, setContent] = useState(""); const [isActive, setIsActive] = useState(false); const onChangewriter = (event:ChangeEvent<HTMLInputElement>) => { setWriter(event.target.value); if (event.target.value !== "" && title && content) return setIsActive(true); setIsActive(false); }; const onChangeTitile = (event:ChangeEvent<HTMLInputElement>) => { setTitle(event.target.value); if (writer && event.target.value && content) return setIsActive(true); setIsActive(false); }; const onChangeContent = (event:ChangeEvent<HTMLInputElement>) => { setContent(event.target.value); if (writer && title && event.target.value) return setIsActive(true) setIsActive(false); }; const onClickSubmit = (event:MouseEvent<HTMLButtonElement>) => [ console.log(writer), console.log(title), console.log(content), alert("게시물 등록이 완료되었습니다"), ]; return ( <> 작성자 : <input type="text" onChange={onChangewriter} /> <br /> 제목 : <input type="text" onChange={onChangeTitile} /> <br /> 내용: <input type="text" onChange={onChangeContent} /> <br /> <button onClick={onClickSubmit} style={{ backgroundColor: isActive === true ? "yellow" : "none" }} > 등록 </button> </> ); }; export default Board;
-
미해결[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
useAuth logout 401에러
안녕하세요 강사님!강사님께서 해당 강의에서 작성해주신대로 우선 Database와 백엔드서버를 구동시킨 채로 프론트엔드 서버를 npx react-native run-ios로 어플을 빌드하고로그아웃 버튼을 클릭했을때 위의 이미지와 같이 401에러가 발생합니다.제가 작성한 코드를 보여드리면src/hooks/queries/useAuth.ts function useLogout(mutationOptions?: UseMutationCustomOptions) { return useMutation({ mutationFn: logout, onSuccess: () => { console.log('useLogout onSuccess'); removeHeader('Authorization'); removeEncryptStorage(storageKeys.REFRESH_TOKEN); }, onSettled: () => { // auth에 해당하는 쿼리들을 캐시 무효화해서 업데이트 queryClient.invalidateQueries({queryKey: [queryKeys.AUTH]}); }, ...mutationOptions, }); } function useAuth() { const logoutMutation = useLogout(); return { logoutMutation, }; } export default useAuth; src/api/auth.tsconst logout = async () => { console.log('logout API call'); try { await axiosInstance.post('/auth/logout'); } catch (err) { console.error(`logout api err :::: ${err}`); } }; export { logout };3. src/api/axios.tsimport axios from 'axios'; const axiosInstance = axios.create({ baseURL: 'http://localhost:3030', withCredentials: true, }); export default axiosInstance;src/utils/header.tsimport axiosInstance from '../api/axios'; function setHeader(key: string, value: string) { axiosInstance.defaults.headers.common[key] = value; } function removeHeader(key: string) { if (!axiosInstance.defaults.headers.common[key]) { return; } delete axiosInstance.defaults.headers.common[key]; } export {setHeader, removeHeader}; src/screens/map/MapHomeScreen.tsximport React from 'react'; import {Button, StyleSheet, Text, View} from 'react-native'; import useAuth from '../../hooks/queries/useAuth'; const MapHomeScreen = () => { const {logoutMutation} = useAuth(); return ( <View> <Text>맵 스크린</Text> <Button title="로그아웃" onPress={() => logoutMutation.mutate(null)} /> </View> ); }; const styles = StyleSheet.create({}); export default MapHomeScreen;
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
create-react-app my app 실행 시 에러
create-react-app my app 실행 시 아래와 같은 에러가 뜹니다. Installing template dependencies using npm...npm error code ERESOLVEnpm error ERESOLVE unable to resolve dependency treenpm errornpm error While resolving: my-app@0.1.0npm error Found: react@19.0.0npm error node_modules/reactnpm error react@"^19.0.0" from the root projectnpm errornpm error Could not resolve dependency:npm error peer react@"^18.0.0" from @testing-library/react@13.4.0npm error node_modules/@testing-library/reactnpm error @testing-library/react@"^13.0.0" from the root projectnpm errornpm error Fix the upstream dependency conflict, or retrynpm error this command with --force or --legacy-peer-depsnpm error to accept an incorrect (and potentially broken) dependency resolution.npm errornpm errornpm error For a full report see:npm error C:\Users\phhyu\AppData\Local\npm-cache\_logs\2025-01-06T07_30_45_069Z-eresolve-report.txtnpm error A complete log of this run can be found in: C:\Users\phhyu\AppData\Local\npm-cache\_logs\2025-01-06T07_30_45_069Z-debug-0.lognpm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^13.0.0 @testing-library/user-event@^13.2.1 web-vitals@^2.1.0 failed
-
미해결배달앱 클론코딩 [with React Native]
java가 아닌 .kt에서 code push 에러가 발생합니다.
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where:Build file '/Users/wootukchoi/FoodDeliveryApp/node_modules/react-native-code-push/android/build.gradle' line: 17 * What went wrong:A problem occurred evaluating project ':react-native-code-push'.> Could not find method android() for arguments [build_2tl5hzetictwda5fo4twhoyrv$_run_closure1$_closure2@6264dc0a] on project ':react-native-code-push' of type org.gradle.api.Project. * Try: package com.fooddeliveryappimport com.facebook.react.ReactActivityimport com.facebook.react.ReactActivityDelegateimport com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabledimport com.facebook.react.defaults.DefaultReactActivityDelegateimport android.os.Bundle;import com.microsoft.codepush.react.CodePushclass MainActivity : ReactActivity() { /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ override fun getMainComponentName(): String = "FoodDeliveryApp" /** * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] */ override fun createReactActivityDelegate(): ReactActivityDelegate = DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) override fun getJSBundleFile(): String { return CodePush.getJSBundleFile() }}
-
미해결배달앱 클론코딩 [with React Native]
flipper 239 에러가 발생합니다.
많은 시도를 해봤지만 계속 안되더라구요 ㅠㅠ error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:Could not determine the dependencies of task ':app:processDebugResources'.> Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'. > Could not find com.facebook.flipper:flipper:0.239.0. Searched in the following locations: - https://oss.sonatype.org/content/repositories/snapshots/com/facebook/flipper/flipper/0.239.0/flipper-0.239.0.pom - https://repo.maven.apache.org/maven2/com/facebook/flipper/flipper/0.239.0/flipper-0.239.0.pom - https://dl.google.com/dl/android/maven2/com/facebook/flipper/flipper/0.239.0/flipper-0.239.0.pom - https://www.jitpack.io/com/facebook/flipper/flipper/0.239.0/flipper-0.239.0.pom Required by: project :app > project :react-native-flipper * Try:> Run with --stacktrace option to get the stack trace.> Run with --info or --debug option to get more log output.> Run with --scan to get full insights.> Get more help at https://help.gradle.org. BUILD FAILED in 1s.
-
미해결배달앱 클론코딩 [with React Native]
package.json에 /lib/panino.js 문제입니다.
해당에러가 뜹니다 무시해도되는걸까요? 비밀@비밀-ui-MacBookPro node_modules % npx pod install(node:21857) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead.(Use node --trace-deprecation ... to show where the warning was created)(node:21857) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/비밀/.npm/_npx/a0ca5f5666585aa2/node_modules/pm2/node_modules/isbinaryfile/package.json' of './lib/panino.js'. Please either fix that or report it to the module authorPOD ERR unknown command install
-
해결됨[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스
[js section07-2-2] 타이머 값 변경에 대해서
if(타이머 === "아직실행안함") 상태에서스크롤퍼센트가 >= 0.7 이면 타이머 값을 다른 값으로 변경해주어야타이머 = setTimeout(()=>{타이머="아직실행안함"},1000)이 코드로 스로틀링 되는게 아닌가요?영상에서는 타이머 값을 다른 값으로 변경해주지 않는데 이러면 타이머 = setTimeout(()=>{타이머="아직실행안함"},1000)이 코드를 추가하기 전과 같지 않나요?
-
미해결[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
useAuth
22:41 타임을 보시면src/hooks/queries/useAuth.ts파일에서 리액트 쿼리를 이용하여 선언한 것을 useAuth라는 함수로 만들어서 반환해주고 있는데요function useAuth() { const signupMutation = useSignup(); const refreshTokenQuery = useGetRefreshToken(); const getProfileQuery = useGetProfile({ enabled: refreshTokenQuery.isSuccess, // true일떄 쿼리가 실행 }); const isLogin = refreshTokenQuery.isSuccess; const loginMutation = useLogin(); return { signupMutation, refreshTokenQuery, getProfileQuery, isLogin, loginMutation, }; } src/navigations/root/RootNavigator.tsx 파일에서 위의 함수를 호출할때 const isLogin = useAuth();로 반환받고있습니다. 구조분해할당이 아니라 객체 그 자체로 받는 이유가 있을까요?
-
미해결[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
[!] Error installing boost
❗질문 작성시 꼭 참고해주세요현재 문제(또는 에러)와 코드(또는 github)를 첨부해주세요. 맥/윈도우, 안드로이드/iOS, ReactNative, Node 버전 등의 개발환경을 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황을 올려주세요. (일부만 자르거나 복사하지말아주세요.) 개발환경/코드에 대한 정보가 없을경우 답변이 어렵습니다.다시 따라해보는중인데npx react-native@0.72.6 init ykservice --version 0.72.6로 할경우 cocoapods 설치시 boost 설치 실패에러가 발생합니다. 0.72.6 으로 진행하려면 아래 링크 참조하여 수정하면 가능합니다. https://github.com/boostorg/boost/issues/843#issuecomment-1872943124 근데 인퍼런은 수업별로 질문게시판이 있으면 좋겠네요.
-
해결됨[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스
이 강좌를 수강 하면 게시판을 만들수 있나요?
강좌 목록에는 페이징 게시글 관련사항이 있는데 Db와 연결해서게시판을 만들 수 있나요
-
해결됨[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
1-5는 Mac 기준으로 설명이 되는 것 같은데 Windows 에서도 진행해야하는건가요?
윈도우 환경의 수강생입니다. 1-5를 진행하려 하는데 npm 이 실행이 안되어서 진행을 못하고 있습니다.윈도우 환경에서도 1-5는 수행을 해야하는건가요?
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
포스트맨 질문
[그랩마켓] axios로 네트워크 통신하기 편 수강 중 질문이 생겼습니다. 강의 중 31초에 보면 Body 부분이 HTML로 되어있는데 그 전까지는 JSON으로 하라고 했다가 갑자기 언급 없이 변경이 돼있어서 HTML로 해야되는지 JSON으로 해야되는지 헷갈립니다.강의 중 4분 10초와 같이 통신 결과, status:200, 화면도 잘 뜹니다. 그런데 data에 화살표가 생기고 누르면 그 아래 products 객체 아래 배열대로 화살표가 생기고 하는데 저는 그냥 data에 값들이 쭉 나열만 되어있습니다. 이 부분을 강의에서처럼 바꾸고 싶습니다.
-
미해결[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
배포 질문인데요
오류에 관련된 질문은 아니고 일반적인 질문 입니다 .개발을 완료후 안드로이드에 배포를 하려고 하는데 테스트를 꼭 거쳐야 배포가 가능 한가요?
-
해결됨[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스
강의자료가 안뜹니다
강의 자료가 있는 항목을 누르면이렇게 아무것도 뜨지 않습니다 ㅜ
-
미해결[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
css에서 <View>가 없다면 왜 두 버튼 크기가 달라지는 지 궁금합니다.
<Pressable disabled={inValid} style={({pressed}) => [ styles.container, styles[size], pressed ? styles[`${variant}Pressed`] : styles[variant], inValid && styles.inValid, ]} {...props}> {/* <View style={styles[size]}> */} <Text style={[styles[`${variant}Text`], styles.text]}>{label}</Text> {/* </View> */} </Pressable> 강의 내용대로 수정을 진행하면 만들어주신대로 코드가 정상작동합니다. 그런데, 저는 강의 3:49초에서 <View/>를 넣기 전에도 동일한 width여야 된다 생각하는데, 왜 여기서 두 버튼의 크기가 다르고 view를 넣으면 어째서 고쳐지는 지를 잘 모르겠습니다.( text 크기 따라서 달라지는 거 같은데, pressable이 100%이니 view가 없어도 같은 크기여야하는 거 같은데 이해를 잘 못하겠습니다.)
-
해결됨[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스
백엔드도 '완벽한' 시리즈 코스가 나오나요?
백엔드도 나온다면 완벽한 시리즈로 듣고 싶어서요
-
해결됨[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
카카오 어드민 세팅 이슈
카카오에 로그인하면 이런 오류가 뜨는데 어떡하죠?
-
미해결[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
안드로이드용으로 npm start 했을 때 빌드에 실패함.
최대한 강의에서 나온대로 했지만, 계속 npm start에서 문제가 일어납니다. 환경변수랑, npm start 당시에 Pixel 5 API 33을 켜둔 상태였습니다... 계속 안되니깐 화가 나네요로그는 다음과 같습니다.C:\Users\sc003\Desktop\Visual Stdio code\Matzip>npm start> Matzip@0.0.1 start> react-native start(node:9660) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.(Use node --trace-deprecation ... to show where the warning was created) Welcome to Metro v0.76.8 Fast - Scalable - Integratedr - reload the appd - open developer menui - run on iOSa - run on Androidinfo Opening the app on Android...info JS server already running.info Launching emulator...info Installing the app...> Task :gradle-plugin:compileKotlin UP-TO-DATE> Task :gradle-plugin:compileJava NO-SOURCE> Task :gradle-plugin:pluginDescriptors UP-TO-DATE> Task :gradle-plugin:processResources UP-TO-DATE> Task :gradle-plugin:classes UP-TO-DATE> Task :gradle-plugin:jar UP-TO-DATE> Task :gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE> Task :app:buildCodegenCLI SKIPPED> Task :app:generateCodegenSchemaFromJavaScript SKIPPED> Task :app:generateCodegenArtifactsFromSchema SKIPPED> Task :app:generatePackageList> Task :app:preBuild> Task :app:preDebugBuild> Task :app:compileDebugAidl NO-SOURCE> Task :app:compileDebugRenderscript NO-SOURCE> Task :app:generateDebugBuildConfig UP-TO-DATE> Task :app:javaPreCompileDebug UP-TO-DATE> Task :app:checkDebugAarMetadata UP-TO-DATE> Task :app:generateDebugResValues UP-TO-DATE> Task :app:mapDebugSourceSetPaths UP-TO-DATE> Task :app:generateDebugResources UP-TO-DATE> Task :app:mergeDebugResources UP-TO-DATE> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE> Task :app:extractDeepLinksDebug UP-TO-DATE> Task :app:processDebugMainManifest UP-TO-DATE> Task :app:processDebugManifest UP-TO-DATE> Task :app:processDebugManifestForPackage UP-TO-DATE> Task :app:processDebugResources UP-TO-DATE> Task :app:compileDebugJavaWithJavac UP-TO-DATE> Task :app:mergeDebugShaders UP-TO-DATE> Task :app:compileDebugShaders NO-SOURCE> Task :app:generateDebugAssets UP-TO-DATE> Task :app:mergeDebugAssets UP-TO-DATE> Task :app:compressDebugAssets UP-TO-DATE> Task :app:processDebugJavaRes NO-SOURCE> Task :app:mergeDebugJavaResource UP-TO-DATE> Task :app:checkDebugDuplicateClasses UP-TO-DATE> Task :app:desugarDebugFileDependencies UP-TO-DATE> Task :app:mergeLibDexDebug UP-TO-DATE> Task :app:dexBuilderDebug UP-TO-DATE> Task :app:mergeProjectDexDebug UP-TO-DATE> Task :app:mergeDebugJniLibFolders UP-TO-DATE> Task :app:mergeDebugNativeLibs UP-TO-DATE> Task :app:stripDebugDebugSymbols UP-TO-DATE> Task :app:validateSigningDebug UP-TO-DATE> Task :app:writeDebugAppMetadata UP-TO-DATE> Task :app:writeDebugSigningConfigVersions UP-TO-DATE> Task :app:mergeExtDexDebug UP-TO-DATE> Task :app:packageDebug UP-TO-DATE> Task :app:createDebugApkListingFileRedirect UP-TO-DATE> Task :app:installDebugInstalling APK 'app-debug.apk' on 'Pixel_5_API_33(AVD) - 13' for :app:debugInstalled on 1 device.BUILD SUCCESSFUL in 8s38 actionable tasks: 2 executed, 36 up-to-dateinfo Connecting to the development server...info Starting the app...Error: Command failed with exit code 1: adb shell am start -n com.matzip/com.matzip.MainActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER at makeError (C:\Users\sc003\Desktop\Visual Stdio code\Matzip\node_modules\execa\lib\error.js:60:11) at module.exports.sync (C:\Users\sc003\Desktop\Visual Stdio code\Matzip\node_modules\execa\index.js:194:17) at tryLaunchAppOnDevice (C:\Users\sc003\Desktop\Visual Stdio code\Matzip\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\tryLaunchAppOnDevice.js:47:22) at C:\Users\sc003\Desktop\Visual Stdio code\Matzip\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:96:39 at Array.forEach (<anonymous>) at runOnAllDevices (C:\Users\sc003\Desktop\Visual Stdio code\Matzip\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:91:48) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Command.handleAction (C:\Users\sc003\Desktop\Visual Stdio code\Matzip\node_modules\@react-native-community\cli\build\index.js:111:9)info Run CLI with --verbose flag for more details.Matzip 폴더에 android > app > src > AndroidMainfest.xml 에<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.matzip">이런식으로 넣어두었는데도 안됩니다..
-
해결됨[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스
질문드립니다
안녕하세요,수업 잘 듣고 따라가고 있습니다~~!! 다름이 아니라 , 아무래도 graphQL를 이용한것보다 취직하고싶은 회사에서 대부분REST API를 사용하는거같아 혹시 fetch 또는 axios를 사용하는 방법은 강의에 추가할 계획이 없으실까요?그리고 nextjs에서는 axios를 사용하는 대신에 fetch를 사용하는것이 맞을까요?