Skip to main content
InterviewHubPRO
Section Overview
Q360

Question 360 of 407

Part 9: React Hooks Deep Dive (262 - 316)

88%
React Core & Hooks (407 Qs)•Part 9: React Hooks Deep Dive (262 - 316)

How to avoid using relative path imports in create-react-app?

mid LevelCode ExampleHooks

Create a file called .env in the project root and write the import path:

ini
    NODE_PATH=src/app
scss
After that restart the development server. Now you should be able to import anything inside `src/app` without relative paths.