in React JS by
Q:

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

1 Answer

0 votes
by

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

NODE_PATH=src/app

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

Click here to read more about React JS
Click here to read more about Insurance

Related questions

0 votes
asked Mar 1, 2020 in React JS by RShastri
0 votes
0 votes
asked Jan 30 in React JS by rajeshsharma
0 votes
asked Mar 2, 2020 in React JS by RShastri
0 votes
asked Dec 8, 2020 in React JS by SakshiSharma
0 votes
0 votes
asked Jan 31 in React JS by Robindeniel
0 votes
...