HomeSoftware EngineeringWhy and Methods to Use Absolute Imports in React | by Sabesan...

Why and Methods to Use Absolute Imports in React | by Sabesan Sathananthan


import {MyComponent} from ‘parts/MyComponent’;

Utilizing TypeScript

Utilizing JavaScript

import {MyComponent} from ‘parts/MyComponent’;
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@element/*": ["src/components/*"],
}
}
}
import {MyComponent} from ‘@element/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