What does the @ symbol mean in a react import statement

Path mappings are aliases that point to specific folders

If you are using Typescript (which the tag suggests you are) it’s possible to setup “path mapping” in your tsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@": ["./src"],
      "@/*": ["./src/*"],
      "@components": ["./src/components"]
    }
  }
}

This will create an alias for “@components” that points to a specific folder.

Read more about it here: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping

Other possibilities

It could be a scoped package like @types/xxx but this is unlikely in the given case.

Leave a Comment