I'll see imports in React that look like:
import {object} from '@library/component'
What is the @
referring to and what kind of import is this? Thanks!
These are scoped packages
Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package.
The import is using a specifically named import vs the default import which can be used to namespace exports.
It's just not limited to React only but it's a part of npm and many other framework also use it (Angular etc). In addition to what Lance mentioned here are some advantages of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With