Friday, March 25, 2022
HomeSoftware EngineeringWhy and Tips on how to Use Absolute Imports in React |...

Why and Tips on how to Use Absolute Imports in React | by Sabesan Sathananthan


import {MyComponent} from ‘elements/MyComponent’;

Utilizing TypeScript

Utilizing JavaScript

import {MyComponent} from ‘elements/MyComponent’;
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@part/*": ["src/components/*"],
}
}
}
import {MyComponent} from ‘@part/MyComponent’;

For VS Code

For WebStrom / IntelliJ Concept

With ESLint

By Conference

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments