Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- java
- gulp
- tomcat
- 이클립스
- npm
- 보일러플레이트
- Sass
- MUISystem
- React
- JOYUI
- Study
- TaskRunner
- animation
- css
- CSS3
- ref
- error
- Eclipse
- ref전달하기
- frontend
- MUIbase
- 정적웹사이트
- SSR
- html
- next.js
- 자바스크립트
- JavaScript
- Adobe
- VW
- 1분코딩
Archives
- Today
- Total
프론트 개발 블로그
[React] 절대 경로 사용하여 모듈 가져오기 본문
문제
리액트에서 컴포넌트 모듈 가져올 때 경로 설정하는 방법.
depth가 깊어질수록 경로 설정이 불편하기 때문에 사용.
해결
jsconfig.json (타입 스크립트를 사용한다면 tsconfig.json) 파일을 생성하여 옵션을 작성하면 된다.
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
create-react-app.dev/docs/importing-a-component/#absolute-imports
반응형
'React' 카테고리의 다른 글
| MUI - material UI, MUI base, JOY UI, MUI System 차이 (1) | 2025.07.25 |
|---|---|
| Error: Node Sass version 5.0.0 is incompatible with ^4.0.0. (0) | 2021.01.05 |
| windowing 라이브러리 (0) | 2021.01.05 |
| Ref 와 DOM (0) | 2020.12.17 |
| Forwarding Refs (React.forwardRef) (0) | 2020.12.14 |