본문 바로가기
728x90
728x90

이슈관리11

tailwind template literal 사용 시 스타일 적용 문제 상황 tailwind를 사용하여 sns 로그인 버튼의 color를 sns의 종류에 맞게 설정하기 위해서 props로 color를 넘겨주고 템플릿 문자열을 사용했지만 color가 적용되지 않았다. 잘못된 코드 tailwind에서 background를 스타일링 하기 위해서는 앞에 bg를 붙여야 하는데 템플릿 문자열과 함께 쓰니 문제가 생겼다. tailwind 공식 문서에 따르면 Dynamic class name을 설정할 때는 항상 완전한 클래스 이름으로 설정해야 한다. 존재하지 않는 클래스 이름은 생성하지 않기 때문이다. props를 이용하여 color를 설정하고 싶다면 다음과 같이 설정한다. function Button({ color, children }) { const colorVariants = .. 2023. 3. 6.
FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists with different options or config (app/duplicate-app) 오류 FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists with different options or config (app/duplicate-app) 오류 문제 상황 firebase를 통해서 이미지를 업로드 하는 과정에서 아래와 같은 오류가 발생하였다. ⚠️FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists with different options or config (app/duplicate-app) 잘못된 코드 문제점은 새로 고침을 하게 되었을 때 firebase app의 config 설정이 이미 되어있어서 새로 설정할 필요가 없기 때문에 발생한다. 개선한 .. 2023. 1. 27.
Uncaught TypeError: Class extends value #<Object> is not a constructor or null 오류 Uncaught TypeError: Class extends value # is not a constructor or null 오류 문제 상황 함수형 컴포넌트를 클래스형 컴포넌트로 바꾸는 과정에서 다음과 같은 오류가 발생했다. ⚠️Uncaught TypeError: Class extends value # is not a constructor or null 잘못된 코드 import Component from "react"; class User extends Component { render() { return {this.props.name}; } } // const User = (props) => { // return {props.name}; // }; export default User 문법 상의 문제는.. 2023. 1. 26.
728x90
728x90