- Learn React with TypeScript 3
- Carl Rippon
- 62字
- 2021-06-10 19:16:37
Default exports
We can specify a single item that can be exported by default using the default keyword:
export default interface {
name: string;
unitPrice: number;
}
Notice that we don't need to name the interface. We can then import a default exported item using an import statement without the curly braces with a name of our choice:
import Product from "./product";