Created
April 6, 2018 17:30
-
-
Save ratbeard/bb81f32ef3a5d8abdc297d7ca93dcf4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1 - rename type | |
| import { IBreadcrumb, BreadcrumbFrontend, BreadcrumbData, SomeOtherNamingConvention } from 'types' | |
| export class Breadcrumb extends Component {} | |
| // 2 - rename component. yuck | |
| import { Breadcrumb } from 'types' | |
| export class BreadcrumbComponent extends Component {} | |
| // 3 - alias import. vscode's auto-import won't know to alias and it may give confusing type error before you add the import | |
| import { Breadcrumb as BreadcrumbType } from 'types' | |
| export class Breadcrumb extends Component {} | |
| // 4 - alias export | |
| import { Breadcrumb } from 'types' | |
| class BreadcrumbComponent extends Component {} | |
| export { BreadcrumbComponent as Breadcrumb } | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yea #3 is too confusing. I've got this, where
Breadcrumb[]is refering to the class below it and its not giving me a compile error.