🧩Javascript 11

멀티타이머 개인정보 처리방침

('https://jiundev.tistory.com/'이하 '지운')은(는) 「개인정보 보호법」 제30조에 따라 정보주체의 개인정보를 보호하고 이와 관련한 고충을 신속하고 원활하게 처리할 수 있도록 하기 위하여 다음과 같이 개인정보 처리방침을 수립·공개합니다. ○ 이 개인정보처리방침은 2022년 3월 25부터 적용됩니다. 제1조(개인정보의 처리 목적) ('https://jiundev.tistory.com/'이하 '지운')은(는) 다음의 목적을 위하여 개인정보를 처리합니다. 처리하고 있는 개인정보는 다음의 목적 이외의 용도로는 이용되지 않으며 이용 목적이 변경되는 경우에는 「개인정보 보호법」 제18조에 따라 별도의 동의를 받는 등 필요한 조치를 이행할 예정입니다. 제2조(개인정보의 ..

React Native 네비게이션 사용하기(feat typescript)

대부분의 앱에서는 화면간 이동이 필요합니다. 플러터와 달리 리액트 네이티브에선 서드파티에 의존해서 해당 기능을 구현해야 합니다. 우선 필요한 라이브러리들을 설치해주겠습니다. yarn add @react-navigation/native react-native-screens react-native-safe-area-context @react-navigation/native-stack App.tsx를 NavigationContainer로 감싸주어야 사용할 수 있습니다. import React from "react"; import { NavigationContainer } from "@react-navigation/native"; function App() { return ( {} ); } export defa..

Next.js 로컬 실행시 에러

에러로그 listen EACCES: permission denied 0.0.0.0:3000 at Server.setupListenHandle [as _listen2] (node:net:1313:21) at listenInCluster (node:net:1378:12) at Server.listen (node:net:1465:7) (...) { code: 'EACCES', errno: -4092, syscall: 'listen', address: '0.0.0.0', port: 3000 } 해결과정 1. netstat -ano | find "3000" 커맨드로 3000포트를 찾아보았지만 실행중이지 않음 2. 관리자권한으로 실행해보고 혹시 윈도우에선 안되는 명령어일지 몰라서 gitbash로 해봄. 역시 안됌 ..

React의 useState 알아보기.

리액트 공부를 하던 중 const Counter = () => { const [count, setCount] = useState(0); const onIncrease = () => { setCount(count + 1); } const onDecrease = () => { setCount(count - 1); } return ( {count} + - ) } 이러한 형태의 카운터를 구현해보았다. 내 지식에 의하면 count + 1 이나 count++이나 같다고 생각하고 위 예제를 count++로 바꾸어보았다. WARNING in src\Counter.js Line 8:18: 'count' is constant no-const-assign Line 12:18: 'count' is constant no-con..

🧩Javascript 2022.04.01

Nest.js Repository Pattern활용하기

Nest.Js 에서 Repository pattern을 활용해 봅시다. Nest에선 컨트롤러는 서비스를 바라보고 있습니다. TypeOrm을 사용하는 중이고 서비스에 비지니스 로직만 남겨두고 쿼리로직을 분리시키고 싶다면 레포지토리 패턴을 활용하면 됩니다. controller : request, response service : business repository : query logic 이런식으로 분리해서 사용하면 조금 더 구조를 체계적으로 나눌 수 있게됩니다. 적용 전 코드와 적용 후 코드를 비교하면서 보도록 하겠습니다. 종속성 주입시 레포지토리를 만들면서 Entity를 주입하고 쿼리 로직을 서비스 안에서 만들어서 DB에 저장하는 형태를 하고 있습니다. 비즈니스 로직과 쿼리 로직이 섞여있어 지저분해 보입..

ERROR [TypeOrmModule] Unable to connect to the database. Retrying /src/entity/user.entity.ts:1import { Entity, Column, PrimaryGeneratedColumn } from "typeorm";

typeorm을 활용해서 NestJs DB 연결중 생긴 에러 원인 entity를 제대로 찾지 못함 해결방법 TypeOrmMoudule.forRoot부분에 entities 경로를 구조에 맞게 잘 작성 프로젝트 폴더 구조 entities: [__dirname + '/entity/**/*.entity{.ts,.js}',], 이렇게 경로 수정 ERROR [ExceptionHandler] No repository for "EntityName" was found. Looks like this entity is not registered in current "default" connection? 수정 후 이런 에러 발생. import { Entity, Column, PrimaryGeneratedColumn } fro..

NestJs 도커로 MySql 연동하기

OS: 윈도우11 설치된 Mysql 버전을 확인해줍니다. $ mysql --version mysql Ver 8.0.28 for Win64 on x86_64 (MySQL Community Server - GPL) 저는 8.0.28 버전이 깔려있네요. Docker를 설치해 줍니다. https://www.docker.com/products/docker-desktop Docker Desktop for Mac and Windows | Docker Learn why Docker Desktop is the preferred choice for millions of developers building containerized applications. Download for Mac or Windows. www.docke..

[ReactNative]TypeScript 템플릿 프로젝트 cli 에러

RN 프로젝트를 타입스크립트로 프로젝트를 생성하려고 npx react-native init LearnType --template react-native-template-typescript 해당 명령어를 입력하면 잘 되는것 같다가 error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found". 이런 에러가 나는데요 rn cli 개발은 이미 커뮤니티로 넘어가서 그렇다고 합니다. npm uninstall -g react-native-cli 기존 cli는 지워주시구요 npm i -g @react-native-community/cli 커뮤니..

[ReactNative]* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

react native로 간단한 앱 구현을 하면서 공부하던중 패키지 네임이 중복되어 파이어베이스에 등록이 되지 않았다. (패키지 네임을 변경하는건 생각보다 쉬우나 한번에 잘 생각해서 정하는 걸 추천) 변경 후 앱을 실행했는데 위 사진과 같이 에러가 생겼다. app.json파일을 열어보자 { "name": "my_first_project", "displayName": "my_first_project" } packagename은 simpletodo로 바꾸었는데 app.json은 변경하지 않아서 생긴 에러 app.json내에 name도 맞춰주니 해결되었다. 참고링크 https://stackoverflow.com/questions/62649381/invariant-violation-main-has-not-bee..