강의

멘토링

로드맵

Inflearn Community Q&A

heonpage's profile image
heonpage

asked

Node and React series that you can learn by following - Creating a Reddit site (NextJS) (Pages Router)

import { User } from "../entities/User"

Resolved

Written on

·

224

0

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.

백엔드 entities에서 Post, Sub, Comment는 아래와 같이

import Post from "../entities/Post"
import Sub from "../entities/Sub"
import Comment from "../entities/Comment"

처럼 불러올 수 있게 작성하셨는데 User만

import {User} from "../entities/User"

중괄호를 넣어서 불러와야 합니다. 

 

 

export default class User extends BaseEntity 

가 아닌

export class User extends BaseEntity 

로 작성한 이유가 있을까요?

nodejspostgresqldockertypescriptreactNext.js클론코딩

Answer 1

1

John Ahn님의 프로필 이미지
John Ahn
Instructor

안녕하세요 heonpage님

아 그 부분을 발견하셨네요 ~

전혀 특별한 이유 없으며 제가 좀 더 신경을 써서 코드를 작성해야 했던 부분입니다.

통일해서 작성하는 게 훨씬 더 좋은 코드입니다.

감사합니다.

heonpage's profile image
heonpage

asked

Ask a question