강의

멘토링

로드맵

Inflearn Community Q&A

elena's profile image
elena

asked

A real introductory all-in-one development boot camp for non-majors

[그랩마켓] Web Development with React - 2

React로 웹개발하기 2 - 콤포넌트 명명

Resolved

Written on

·

178

1

index.js에서 함수의 이름은 Mainpage인데, app.js에서 불러와서 return할때는 MainPageComponent일까요??

이전에 ChildComponent는 함수이름에 Component가 들어가서 이 부분은 그냥 함수명을 그대로 쓰면 되는거구나 했는데.. 함수명에 콤포넌트를 따로 써줘야하는건지 import규칙이 혼선이 옵니다.

HTML/CSStensorflowexpress머신러닝 배워볼래요? reactreact-nativejavascriptnodejs

Answer 1

0

grab님의 프로필 이미지
grab
Instructor

안녕하세요! 정말 좋은 질문 감사합니다 :)

말씀하신대로 보통 export하는 함수의 이름을 그대로 return 구문에 넣어주는 게 일반적인 방식입니다!
제가 강의를 진행하면서 Component라는 용어를 강조하기 위해 뒤에 Component를 붙였다는 점 참고해주시면 됩니다 ㅎㅎ

elena님의 프로필 이미지
elena
Questioner

네, 감사합니다. 함수 이름외에 component라는 text를 추가로 붙여도 동작하는 건가봐요.

elena's profile image
elena

asked

Ask a question