Web 240

NextJS Api 키 등 중요 변수 숨기기

https://velog.io/@himprover/NextJs-env.local-%EC%82%AC%EC%9A%A9%ED%95%B4%EC%84%9C-%EC%A4%91%EC%9A%94-%EB%B3%80%EC%88%98-%EC%88%A8%EA%B8%B0%EA%B8%B0-feat.-api-key NextJS env.local 사용해서 중요 변수 숨기기 (feat. api key) 보통 오픈소스를 개발하면 github에 많이 업로드 한다.오픈소스 중에는 openApi를 사용해서 개발하는 경우도 있는데 이 때 api 인증키가 사용된다.api에 따라 다르지만, 대부분 api 인증키가 본인 이외 velog.io

Web/ReactJS 2022.04.19

HTML로 리다이렉트 하기

자바스크립트를 사용하지 못하는 환경이거나 HTML만 사용할 수 있는 환경에서 주소 이동을 하고 싶은 경우 사용한다. ex) aws 로드밸런서의 리 다이렉션 등 (https -> http로 리다이렉트도 가능) 보안적인 이슈가 있을 수 있으니 조심하여 사용할 것 text/html 타입으로 설정한 뒤 head 태그 안에 meta 태그를 넣어준다. content 안의 0은 리다이렉션 대기 시간이고 세미콜론 이후에 주소를 넣어준다.

Web/Html_Css 2021.09.29

리액트에러 해결 A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for..

리액트에서 A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. 에러가 발생할 경우 값변경이 제대로 되지 않는 경우가 있다 이 경우는 받아온 DTO나 state가 null일 경우이다 value={dto.name} 이렇게 들어간 코드를 value={dto.name || ''} 이런식으로 널처리를 해주면..

Web/ReactJS 2021.05.24

react js / next js quill 적용

react 적용시 bigexecution.tistory.com/6 React 게시판 만들기 : React-Quill (4) 리액트 에디터로 Quill을 사용하기로 했다. 무료로 사용 가능하다. npm install react-quill 우선 react-quill을 설치한다. npm install react-quill package.json 파일 dependencies 에 아래와 같이 설치됨 확.. bigexecution.tistory.com (위의 코드와 아래의 코드를 참고하여 같이 사용하면 쉽게 만들 수 있음) next 적용시 아래 블로그에서 시행착오를 겪은 마지막 코드를 이용하고 툴바는 위의 코드를 이용하면 됨 m.blog.naver.com/choirj91/222044740530 next, react..

Web/ReactJS 2021.02.17

next js 시작하기

타입 스크립트 버전으로 설치 next js (ts 버전) 설치 npx create-next-app 앱이름 --ts # or yarn create next-app 앱이름 --typescript 작동 해당 앱폴더로 이동하여 npm dev #or yarn dev 상대경로 -> 절대경로로 바꾸기 tsconfig.json 파일에 아래를 추가 { [기타내용], "compilerOptions": { [기타내용], "baseUrl": ".", "paths": { "@/*": [ "./*" ] } }, [기타내용], } mobx 설치 yarn add mobx 또는 npm install --save mobx 설치 후 작동이 안될 경우 .next / node_modules / package-lock.json 을 지우고 ya..

Web/ReactJS 2021.02.15