What does @ mean while importing libraries in JavaScript? import '@library-name'

157 views Asked by At

For example: import { createDrawerNavigator } from '@react-navigation/drawer';

What is the significance of the '@'?

I tried looking it up but the answers explained its usage as a pointer to the root directory. (as explained here.)

1

There are 1 answers

0
David Neil On BEST ANSWER

NPM packages are sometimes published under a "scope".

When used in package names, scopes are prefixed with @. So drawer in the react-navigation scope is published as @react-navigation/drawer.

See https://docs.npmjs.com/cli/using-npm/scope for more information.