javascripttypescriptes6-moduleses6-module-loader

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


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.)


Solution

  • 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.