DEV Community

Discussion on: Exports and Imports and Defaults, Oh My!

Collapse
 
terabytetiger profile image
Tyler V. (he/him)

Not that there's a use for this, but is there a way to assign names to the imports when running

import {App, Dev, Post} from "./App"

For example, is there a way to import App as Whatever and Post as Thing?

Collapse
 
laurieontech profile image
Laurie • Edited

Yup!

If it's a named import it's this.

import {App as Whatever} from "./App"